|
|
Source Code <script language="javascript"><!-- function new_onclick() { //validating whether the input is blank if (document.ContactsFolder.txtFolder.value == "") { alert("Please enter a name for New Folder."); document.ContactsFolder.txtFolder.focus(); return false; } else { //validating whether the input contains any space or invalid characters var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; var checkStr = document.ContactsFolder.txtFolder.value; var allValid = true; for (i = 0; i < checkStr.length; i++) if (j ==
checkOK.length) if (!allValid) <head> <title>Validating Input</title> </head> <body> <form name="ContactsFolder"> <p><input type="text" name="txtFolder" size="20"> <input type="submit" name="submit" value="ok" onClick="javascript:new_onclick()"> </p> </form> </body> </html> |
Send mail to santhosh_emids@yahoo.com with questions or comments about
this web site.
|