easy question building character count in asp.net

I need to build the textboxarea with the number of characters remaINING.
please see attached file.

characters.png
mathieu_cuprykAsked:
Who is Participating?
 
aplusexpertCommented:
Hi

Just one step ahead, write javascript to count typed character and subtract from the max length in keypress event.

Thanks
0
 
mathieu_cuprykAuthor Commented:
this I need in there.
0
 
apexpertCommented:
<SCRIPT LANGUAGE="JavaScript">

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

onKeyDown="textCounter(document.myForm.message1,document.myForm.remLen1,125)"

onKeyUp="textCounter(document.myForm.message1,document.myForm.remLen1,125)"
0
 
mathieu_cuprykAuthor Commented:
k
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.