Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Log In Form </title>
- </head>
- <body> <center>
- <font size=50 face=helvetica> <h1 style="border:5px solid;color:black;"> Log In </font><br>
- <form name="myForm">
- <div><font face=helvetica size=6>
- Username <input type="text" placeholder="Enter Your Username" id="fname" size=30 name="fname" required> <br> <br> <br> <br>
- Password <input type="password" placeholder="Enter Your Password" id="pword" name="pword" required> <br> <br> <br> <br>
- <input type=submit onClick="enterUsername(),inputPass(),enterPassword()" id="button" value="OK">
- <input type=reset value="CANCEL"> </div>
- </form>
- <script>
- function enterUsername() {
- var x = document.forms["myForm"]["fname"].value;
- if (x == "") {
- alert("Name must be filled out");
- return false;
- }
- }
- </script>
- <script>
- function inputPass() {
- var x = document.forms["myForm"]["pword"].value;
- if (x == "") {
- alert("Password must be filled out");
- return false;
- }
- }
- </script>
- <script>
- function enterPassword() {
- var username = document.getElementById("fname").value;
- var password = document.getElementById("pword").value;
- if (username == "1234") {
- if(password == "hello"){
- alert("Login Successful");
- location.href = "project mainframe.html";
- return true;
- }
- else {
- alert("Either Username or Password is incorrect");
- }
- }}
- </script>
Add Comment
Please, Sign In to add comment