Thursday, January 10, 2008

Character Count for Textarea, Remaining Character

Count and Limit Character Input in Text Boxes:


Put this in between the and tags:
Please view in source code

<script language="JavaScript">
function twdCount(field,cntfield,maxlimit)
{
if (field.value.length > maxlimit)
field.value = field.value.substring(0, maxlimit);
else
cntfield.value = maxlimit - field.value.length;
}
</script>


Here is the form code:


characters left


characters left

No comments: