View Full Version : text area counter

05-15-2011, 09:11 PM
first of all I followed this link but it did not work


I now have my counter working in my form.
This is what I have entered in the head.

<!-- Limit the number of characters per textarea -->
<!-- Begin
function textCounter(field,cntfield,maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
cntfield.value = maxlimit - field.value.length;
// End -->

This is what I have entered in the form. Now my ValidateForm() doesn't work on any of the other text and drop down boxes. They were coming up with an error message if they were not entered and someone tried to enter data in a box past the top one that was mandatory.

<form name="myForm" action="/articles/articles/javascript/dynamictextareacounter.asp?ID=<%=siteID%>" method="post" onsumbit="return validateForm()" enctype="multipart/form-data" id="myForm" >

05-16-2011, 05:19 PM
The forum where you posted this is for submitting a new script. I am now moving it to the area for help with existing scripts.
Additionally, your link does not work-- it says the discussion does not exist.

Please give us more information and we will try to help. Be aware that in posting it's better for you if you are clear, so that we can help. If not, we won't be able to help you. This includes the formatting of your post such as using
.... tags. I've fixed your post above though.