JavaScript Error with form counter that was working fine
Hello,
Maybe it is because I am way too tired as been working non-stop for days :)
But for whatever reason I cannot find out why all of a sudden the JS code on a part of a form is not working.
The code is supposed to count the number of Characters in a textarea field and not allow the user to type
more than the allotted number of Characters. The JS code is:
function textCounter_rem(maxlimit) {
var field = document.getElementById("description");
var cntfield = document.getElementById("rem");
if (field.value.length > maxlimit) {
field.value = field.value.substring(0, maxlimit);}
else
{cntfield.value = maxlimit - field.value.length;}
}
But all of a sudden it is not working!
You can see a sample client page here:
http://www.anoox.com/submit_confirm_...40&action=edit
As you can see when you type in the field for: Description of this Site
The "Number of Characters remaining" field is not changing and the user can type past 200!
Thanks.