Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <script>
- function validation(){
- var x=document.getElementById("username").value;
- var y=document.getElementById("psw").value;
- if ((x==null||x==" ")&&(y==null||y==" ")){
- alert(" Enter name and password ");
- }else if(x==null||x==" ") {
- alert(" You must enter your username ");
- return false;
- }else if(y==null||y==" "){
- alert ("You must enter your password ");
- return false;
- }
- else
- { window.location="login.php"; }
- }
- </script>
- <body>
- <form name= "myform" onsubmit="return validation();" method="post">
- Username: <input type="text" id="username" name="uname"><br> <br>
- Password: <input type="password" id="psw" 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