Guest User

Untitled

a guest
Feb 25th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Log In Form </title>
  4. </head>
  5. <body> <center>
  6.  
  7. <font size=50 face=helvetica> <h1 style="border:5px solid;color:black;"> Log In </font><br>
  8. <form name="myForm">
  9. <div><font face=helvetica size=6>
  10. Username <input type="text" placeholder="Enter Your Username" id="fname" size=30 name="fname" required> <br> <br> <br> <br>
  11. Password <input type="password" placeholder="Enter Your Password" id="pword" name="pword" required> <br> <br> <br> <br>
  12.  
  13.  
  14. <input type=submit onClick="enterUsername(),inputPass(),enterPassword()" id="button" value="OK">
  15.  
  16. <input type=reset value="CANCEL"> </div>
  17. </form>
  18.  
  19. <script>
  20. function enterUsername() {
  21. var x = document.forms["myForm"]["fname"].value;
  22. if (x == "") {
  23. alert("Name must be filled out");
  24. return false;
  25. }
  26. }
  27. </script>
  28.  
  29.  
  30. <script>
  31. function inputPass() {
  32. var x = document.forms["myForm"]["pword"].value;
  33. if (x == "") {
  34. alert("Password must be filled out");
  35. return false;
  36. }
  37. }
  38. </script>
  39.  
  40. <script>
  41. function enterPassword() {
  42. var username = document.getElementById("fname").value;
  43. var password = document.getElementById("pword").value;
  44.  
  45. if (username == "1234") {
  46. if(password == "hello"){
  47.  
  48. alert("Login Successful");
  49. location.href = "project mainframe.html";
  50. return true;
  51. }
  52. else {
  53. alert("Either Username or Password is incorrect");
  54. }
  55. }}
  56. </script>
Add Comment
Please, Sign In to add comment