Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <script>
- var url = "http://www.google.com";
- function validateForm() {
- var x = document.forms["myForm"]["Uname"].value;
- var y = document.forms["myForm"]["Pname"].value;
- if (x == "Joshua")
- {
- if (y == 1234)
- {
- window.open(url)
- }
- }
- else
- {
- alert("You have entered the wrong information!");
- return false;
- }
- }
- </script>
- </head>
- <body style="background-color:lightgrey">
- <form name="myForm"
- onsubmit="return validateForm()" method="post">
- Username: <input type="text" name="Uname">
- Password: <input type="text" name="Pname">
- <input type="submit" value="Submit">
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment