»
EnglishFrenchVietnamese

Print - Max Entry - JavaScriptBank.com

Full version: jsB@nk » Form » Validation » Max Entry
URL: https://www.javascriptbank.com/max-entry.html

Max Entry © JavaScriptBank.comMake sure your visitor doesn't exceed the maximum number of characters that you want to accept in a form. Short too!

Full version: jsB@nk » Form » Validation » Max Entry
URL: https://www.javascriptbank.com/max-entry.html



JavaScript
<SCRIPT LANGUAGE="JavaScript"><!-- Beginfunction checkchars(form) {var max=15;if (form.chars.value.length > max) {alert("Please do not enter more than 15 characters.  Please shorten your entry and submit again.");return false;   }else return true;}// End --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form onsubmit="return checkchars(this)">Please type 15 characters or less.<br><textarea rows=5 cols=30 name=chars wrap=virtual></textarea><br><input type=submit value="Submit!"></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->