Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- function validation(){
- var x=document.getElementById("uname").value;
- var y=document.getElementById("pass").value;
- if (x== null && y==null)
- {
- alert (" Enter name and password ");
- }
- else if(x==null||x==" ") { alert (" You must enter your username ");
- return false;}
- else(y==null||y==" ") { alert ("You must enter your password ");
- return false;} }
- </script>
- <body>
- <form name= "myform" action="login.php" onsubmit="return validation()" method="post">
- Username: <input type="text" name="uname"><br> <br>
- Password: <input type="password" name="pass">
- <br><br>
- <input type="submit" value=" Login"></form>
- <button type="button" onclick="location.href='SignUp.php';">Sign Up</button>
- </body> </html>
Add Comment
Please, Sign In to add comment