html: how to limit text field characters, limit textarea characters, how to limit text box characters in html, how to check characters in text field, textarea, example how to limit text field character
(Website Helper) limit text field character Number of Visitors: Site Map

html: how to limit text field char, text box char, textarea character



Website Design
Website Promotion
Graphic Design
Programming
Free Software
Computer Tips
Discount Stores
This site provides users with the information about html: how to limit text field characters, limit textarea characters, how to limit text box characters in html, how to check characters in text field, textarea, example, and more.

If you think that this site is helpful, please recommend your friends to visit our site.



How to limit text field, text box, textarea characters in html

For limiting text field, text box, textarea characters in html, you need to add a little javascript code. The following is an example for how to limit text field, text box, textarea characters in html.


< script> function checkchars(cur) { var maxlength=50 if (cur.chars.value.length>maxlength){ alert("Please limit your input to 50 or less characters!") return false } } //--> < /script> < form onsubmit="return checkchars(this)"> Please type a title of webpage within 50 chars or less: < br> < input type="text" size="68" name="chars" > < br> < input type="submit" value="Submit!"> < /form> < form onsubmit="return checkchars(this)"> Please type a description of webpage within 50 chars or less: < br> < textarea rows="5" cols="58" name="chars"> < br> < input type="submit" value="Submit!"> < /form>
Now let's look at the above code in action as follows:

Please type a title of webpage within 50 chars or less:

Please type a description of webpage within 50 chars or less:

(Website Helper) limit text field character (c) EduSoftMax - www.edusoftmax.com