Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. <?php
  6.  
  7. function Validation()
  8. {
  9. var x = document.forms["welcome.php"]["name"].value;
  10. if (x==null || x=="") {
  11. alert("Please Enter a User Name!!!");
  12. return false;
  13. }
  14.  
  15. var y = document.forms["welcome.php"]["email"].value;
  16. var atpos = y.indexOf("@");
  17. var dotpos = y.lastIndexOf(".");
  18. if (atpos<1 || dotpos<atpos+2 || dotpos+2>=y.length) {
  19. alert("Not a Valid E-mail Address!!!");
  20. return false;
  21. }
  22. var z = document.forms["welcome.php"]["password"].value;
  23. if (z==null || z=="") {
  24. alert("Please Enter a Password!!!");
  25. return false;
  26. }
  27. }
  28. </script>
  29. </head>
  30. <body>
  31. <form action="welcome.php" onsubmit= "return Validation()" method="post">
  32. Name: <input type="text" name="name"><br>
  33. E-mail: <input type="text" name="email"><br>
  34. Password:<input type="text" name="password"><br>
  35. <input type="submit" value="submit">
  36.  
  37. ?>
  38.  
  39. </form>
  40. </body>
  41.  
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement