Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <title>my webpage</title>
- <script>
- function submitFunction()
- {
- var x= docoument.forms["myforms""] ["username"].value;
- var y= docoument.forms["myforms""] ["password"].value;
- if(x==null || x=="" || y==nill || y=="")
- {
- alert("both fields cannot be empty");
- }
- else{
- if(x=="webi")
- {
- if(y="12345"")
- {
- alert ("login sucessful")
- }
- else{
- alert("password do not match")
- }
- }
- </script>
- </head>
- <body>
- <p> <form name= "myform" onsubmit="submitFunction()">
- username: <input type ="text" name ="username"><br>
- password : <input type="password" name= "pwd"><br>
- <div><input type ="submit" value = "submit"></div>
- </p> </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement