Guest User

Untitled

a guest
Jun 22nd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script>
  5. var url = "http://www.google.com";
  6. function validateForm() {
  7. var x = document.forms["myForm"]["Uname"].value;
  8. var y = document.forms["myForm"]["Pname"].value;
  9. if (x == "Joshua")
  10. {
  11. if (y == 1234)
  12. {
  13. window.open(url)
  14. }
  15. }
  16. else
  17. {
  18. alert("You have entered the wrong information!");
  19. return false;
  20. }
  21. }
  22. </script>
  23. </head>
  24. <body style="background-color:lightgrey">
  25.  
  26. <form name="myForm"
  27. onsubmit="return validateForm()" method="post">
  28. Username: <input type="text" name="Uname">
  29. Password: <input type="text" name="Pname">
  30. <input type="submit" value="Submit">
  31. </form>
  32.  
  33. </body>
  34. </html>
Add Comment
Please, Sign In to add comment