Advertisement
Guest User

Untitled

a guest
Apr 26th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <head>
  2. <title>my webpage</title>
  3. <script>
  4. function submitFunction()
  5. {
  6. var x= docoument.forms["myforms""] ["username"].value;
  7. var y= docoument.forms["myforms""] ["password"].value;
  8.  
  9. if(x==null || x=="" || y==nill || y=="")
  10. {
  11. alert("both fields cannot be empty");
  12. }
  13. else{
  14. if(x=="webi")
  15. {
  16. if(y="12345"")
  17. {
  18. alert ("login sucessful")
  19. }
  20. else{
  21. alert("password do not match")
  22. }
  23. }
  24. </script>
  25.  
  26. </head>
  27. <body>
  28. <p> <form name= "myform" onsubmit="submitFunction()">
  29. username: <input type ="text" name ="username"><br>
  30. password : <input type="password" name= "pwd"><br>
  31.  
  32. <div><input type ="submit" value = "submit"></div>
  33. </p> </form>
  34.  
  35. </body>
  36. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement