M
matt shudy
Hi,
I am using the code below to limit the amount of text a
person can enter into a form field. Is there a way to
display an alert when they have reached the limit?
Thanks,
Matt
in the head
<script language="JavaScript" type="text/javascript">
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) field.value =
field.value.substring(0,
maxlimit);
else countfield.length = maxlimit - field.value.length;
}
</script>
in the body
<TEXTAREA onKeyDown="textCounter(this,this,250);"
onKeyUp="textCounter(this,this,250);" cols=80 name="FIELD"
rows=3
wrap=virtual></TEXTAREA>
I am using the code below to limit the amount of text a
person can enter into a form field. Is there a way to
display an alert when they have reached the limit?
Thanks,
Matt
in the head
<script language="JavaScript" type="text/javascript">
function textCounter(field, countfield, maxlimit) {
if (field.value.length > maxlimit) field.value =
field.value.substring(0,
maxlimit);
else countfield.length = maxlimit - field.value.length;
}
</script>
in the body
<TEXTAREA onKeyDown="textCounter(this,this,250);"
onKeyUp="textCounter(this,this,250);" cols=80 name="FIELD"
rows=3
wrap=virtual></TEXTAREA>