hmpk
05-15-2011, 09:11 PM
first of all I followed this link but it did not work
www.dynamicdrive.com/forums/showthread.php?t=62400
I now have my counter working in my form.
This is what I have entered in the head.
<SCRIPT LANGUAGE="JavaScript">
<!-- 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
else
cntfield.value = maxlimit - field.value.length;
}
// End -->
</script>
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" >
www.dynamicdrive.com/forums/showthread.php?t=62400
I now have my counter working in my form.
This is what I have entered in the head.
<SCRIPT LANGUAGE="JavaScript">
<!-- 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
else
cntfield.value = maxlimit - field.value.length;
}
// End -->
</script>
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" >