Not a Member Yet,
Click here to Register

ID: 124
Viewed: 3793
Added: Apr 26, 2002
Snippet uploaded by: snippet
Written By: The JavaScript Source
Demo: Sorry, no demo

User Rated at: 0 Stars
Rate This:

Thank you for your vote. Please wait...

It appears you already voted for this snippet

It appears your vote value was empty

This neat little script will count the characters in a textarea and will not let you add more text. Browsers: IE5+ NS6+ will not work in NS4.x

<!-- Original: Ronnie T. Moore -->
<!-- Web Site: The JavaScript Source -->

<!-- Dynamic 'fix' by: Nannette Thacker -->
<!-- Web Site: -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

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


 <form name=form1>
<textarea name=content cols=70 rows=18 onKeyDown="textCounter(this.form.content,this.form.remLen,4000);"
<input readonly type=text name=remLen size=4 maxlength=4 value="4000" style="border: 1px;"> characters left</font>

No Comments to show

Please completely fill out the form below if you want to review this snippet. All reviews are subject to validation.

Replying to a Comment...

Adding your comment. Please wait...

Thanks for adding your comment!. After further review it will be added.

There was a problem adding your comment. Please try again.

Please complete all the fields in the form before sending.

© 2002 - 2023 All Rights Reserved. Conditions
Do NOT follow this link or you will be banned from the site!