Advertisement
Guest User

Untitled

a guest
Apr 27th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>MY WEBPAGE</title>
  4. </head>
  5. <body>
  6. <script>
  7. function submitFunction()
  8. {
  9. var x = document.forms["myform"]["username"].value;
  10. var y = document.forms["myform"]["pwd"].value;
  11. if(x == null || x == "" || y == null || y == "")
  12. {
  13. alert("Both fields can't be empty.");
  14. }
  15. else if(x == "Srinivas")
  16. {
  17. if(y=="7899008899")
  18. {
  19. alert("Login Successfull.");
  20. return true;
  21. }
  22. else {
  23. alert("Password do not match");
  24. return false;
  25. }
  26. }
  27. else {
  28. alert("User don't match");
  29. return false;
  30. }
  31. </script><form name="myform" action="index.html" onsubmit="submitFunction()",method="post">
  32. Username: <input type="text" name="username"><br>
  33. Password:<input type="password" name="pwd"><br>
  34. <input type= "submit" value="Submit">
  35. </form>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement