irwan

Validate not for number and simbol

Dec 11th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  4. <title>validate</title>
  5.  
  6. <style type="text/css">
  7.  
  8. </style>
  9. <script type="text/javascript">
  10. <!--
  11. function ValidateForm1(theForm)
  12. {
  13. var strFilter = /^[A-Za-zƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f]*$/;
  14. var chkVal = theForm.Editbox.value;
  15. if (!strFilter.test(chkVal))
  16. {
  17.    alert("Please enter only letter and whitespace characters in the \"Editbox\" field.");
  18.    theForm.Editbox.focus();
  19.    return false;
  20. }
  21. return true;
  22. }
  23. //-->
  24. </script>
  25. </head>
  26. <body>
  27.  
  28. <form name="Form" method="post" action="" enctype="text/plain" id="Form" onsubmit="return ValidateForm1(this)">
  29.  
  30. <input type="password" id="Editbox" name="Editbox" value="">
  31. <input type="submit" id="Button1" name="" value="Submit">
  32. </form>
  33. </div>
  34. </body>
  35. </html>
  36.  
Advertisement
Add Comment
Please, Sign In to add comment