notrc4t
caliace
vieltpas
*PREMIUM MEMBERS ONLY*
If you are not comfortable editing your template and working with HTML code please do not proceed. The code provided is used at your discretion and is not a formal part of the HaloScan offering
The number of characters allowed for a comment differ between standard and premium members, with standard members allowed 3,000 characters per comment, and premium members allowed 10,000 characters per comment.
You can add the following script to your comment template to show the remaining character count to ensure your visitors know when they are running out of space.
To add a comment character count:
Note: You can adjust the maximum post length by changing the variable in the first piece of code, although remember that there is a 10,000 character limit which Haloscan will automatically trim your posts down too.
There's nothing stopping you from adding styles and classes to the tags to make them appear nicer.
Taken from the forum, created by artesa∞
caliace
vieltpas
Showing the remaining characters
*PREMIUM MEMBERS ONLY*
If you are not comfortable editing your template and working with HTML code please do not proceed. The code provided is used at your discretion and is not a formal part of the HaloScan offering
The number of characters allowed for a comment differ between standard and premium members, with standard members allowed 3,000 characters per comment, and premium members allowed 10,000 characters per comment.
You can add the following script to your comment template to show the remaining character count to ensure your visitors know when they are running out of space.
To add a comment character count:
- On the main HaloScan site, from the menu on the left, select Template Gallery.
- In the middle of the page, select the HTML tab.
- Paste the following code between the <head> and </head> tags:
<script language="javascript1.2" type="text/javascript">
<!--
var maxChars = 10000;
function charsleft()
{
theInputBox = document.getElementById('messageText');
theCountBox = document.getElementById('charsLeft');
var currentChars = theInputBox.value.length;
theCountBox.value = Math.max((maxChars - currentChars),0);
if(currentChars > maxChars)
{
theInputBox.value = theInputBox.value.substring(0,maxChars);
}
}
-->
</script>
<!--
var maxChars = 10000;
function charsleft()
{
theInputBox = document.getElementById('messageText');
theCountBox = document.getElementById('charsLeft');
var currentChars = theInputBox.value.length;
theCountBox.value = Math.max((maxChars - currentChars),0);
if(currentChars > maxChars)
{
theInputBox.value = theInputBox.value.substring(0,maxChars);
}
}
-->
</script>
- Locate and replace the following code:
<textarea name="addMessage">{HSVisitorMessage}</textarea>
with this
<textarea name="addMessage" id="messageText" onchange="charsleft()" onkeyup="charsleft()" onfocus="charsleft()" onblur="charsleft()">{HSVisitorMessage}</textarea>
- Then add the following code where you want the count to be displayed (near the comment box is best)
Characters Remaining: <input type="text" readonly="readonly" id="charsLeft" />
- Click Save.
- You may also need to edit your comment stylesheet, changing textarea {width: 100%; } to textarea {width: 342px; }.
Note: You can adjust the maximum post length by changing the variable in the first piece of code, although remember that there is a 10,000 character limit which Haloscan will automatically trim your posts down too.
There's nothing stopping you from adding styles and classes to the tags to make them appear nicer.
Taken from the forum, created by artesa∞