Advertisement
Guest User

Untitled

a guest
Apr 27th, 2016
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 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. }
  16. else
  17. if(x=="Srinivas")
  18. {
  19. if(y=="7899008899")
  20. {
  21. alert("Login Successfull.");
  22. return true;
  23.  
  24. }
  25. else{
  26. alert("Password do not match");
  27. return false;
  28. }
  29.  
  30.  
  31. }
  32. else{
  33. alert("User don't match");
  34. return false;
  35. }
  36. </script><form name="myform" action="index.html" onsubmit="submitFunction()",method="post">
  37. Username: <input type="text" name="username"><br>
  38. Password:<input type="password" name="pwd"><br>
  39. <input type= "submit" value="Submit">
  40. </form>
  41. </body>
  42. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement