Guest User

Untitled

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