Guest User

Untitled

a guest
Jan 19th, 2016
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <script>
  4. function validation(){
  5. var x=document.getElementById("username").value;
  6. var y=document.getElementById("psw").value;
  7. if ((x==null||x==" ")&&(y==null||y==" ")){
  8. alert(" Enter name and password ");
  9. }else if(x==null||x==" ") {
  10. alert(" You must enter your username ");
  11. return false;
  12. }else if(y==null||y==" "){
  13. alert ("You must enter your password ");
  14. return false;
  15. }
  16. else
  17. { window.location="login.php"; }
  18. }
  19. </script>
  20.  
  21. <body>
  22. <form name= "myform" onsubmit="return validation();" method="post">
  23. Username: <input type="text" id="username" name="uname"><br> <br>
  24. Password: <input type="password" id="psw" name="pass">
  25. <br><br>
  26. <input type="submit" value=" Login"></form>
  27. <button type="button" onclick="location.href='SignUp.php';">Sign Up</button>
  28. </body> </html>
Add Comment
Please, Sign In to add comment