Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>MY WEBPAGE</title>
- </head>
- <body>
- <script>
- function submitFunction()
- {
- var x=document.forms["myform"]["username"].value;
- var y=document.forms["myform"]["pwd"].value;
- if(x==null||x==""||y==null||y=="")
- {
- alert("Both fields can't be empty.");
- }
- else
- if(x=="Srinivas")
- {
- if(y=="7899008899")
- {
- alert("Login Successfull.");
- return true;
- }
- else{
- alert("Password do not match");
- return false;
- }
- }
- else{
- alert("User don't match");
- return false;
- }
- </script><form name="myform" action="index.html" onsubmit="submitFunction()",method="post">
- Username: <input type="text" name="username"><br>
- Password:<input type="password" name="pwd"><br>
- <input type= "submit" value="Submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement