Character counter for field

admin

Administrator
Staff member
I have the following script for a character counter -- how do I change it to count up (from 0) instead of down (from determined number)?

Any help or another solution would be greatly appreciated!

~MVA


------head code-----

<!-- Begin Character Counter
var submitcount=0;
function checkSubmit() {

if (submitcount == 0)
{
submitcount++;
document.Surv.submit();
}
}

function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit)
{field.value = field.value.substring(0, maxlimit);}
else
{countfield.value = maxlimit - field.value.length;}
}

------form field code-----

<input type="text" name="Title" size="45" maxlength="45" onKeyDown="textCounter(this.form.Title,this.form.remLentext,45);" onKeyUp="textCounter(this.form.Title,this.form.remLentext,45);";return document.MM_returnValue"><br>Characters remaining: <input type=box readonly name=remLentext size=3 value=http://www.webdeveloper.com/forum/archive/index.php/45>
 
Back
Top