Advertisement
Guest User

Untitled

a guest
Dec 31st, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <title>Testing this script.</title>
  5.  
  6. <head>
  7.         <meta charset="utf-8"/>
  8.     <script>
  9.  
  10.         function newline() {
  11.             document.write("<br>");
  12.         }
  13.         function writeline(what) {
  14.             document.write(what + "<br>");
  15.         }
  16.         function buttonClicked(id, pass) {
  17.  
  18.             if (id == "") {
  19.                 alert("Invalid Username!");
  20.                 return;
  21.             }
  22.             if (pass == "") {
  23.                 alert("Invalid Password!");
  24.                 return;
  25.             }
  26.             console.log(id + ", " + pass)
  27.             number = 0;
  28.             count = id.length;
  29.             pcount = pass.length;
  30.  
  31.             //only did this for fun.
  32.             for (i = 0; i < count; i++) {
  33.                 document.write(number + 1 + ": " + id.substring(i, i + 1) + "<br>")
  34.                 number++;
  35.             }
  36.             document.write("<br>");
  37.             number = 0;
  38.             for (i = 0; i < pcount; i++) {
  39.                 document.write(number + 1 + ": " + pass.substring(i, i + 1) + "<br>")
  40.                 number++;
  41.             }
  42.  
  43.             newline();
  44.             writeline("username: <b>" + id + "</b>");
  45.             writeline("password: <b>" + pass + "</b>")
  46.         }
  47.     </script>
  48.     <style>
  49.         body
  50.     {
  51.         margin:0 auto;
  52.         padding:0;
  53.         text-align:center;
  54.         height:2000px;
  55.         background-color:orange;
  56.     }
  57.     #wrapper
  58.     {
  59.         width:995px;
  60.         padding:0px;
  61.         margin:0px;
  62.         display:flex;
  63.         justify-content: center;
  64.         align-items: center;
  65.         font-family:helvetica;
  66.         text-align:center;
  67.     }
  68.     input[type="text"]
  69.     {
  70.         width:200px;
  71.         height:35px;        
  72.         margin-right:2px;
  73.         border-radius:3px;
  74.         border:1px solid red;
  75.         padding:5x;
  76.     }
  77.     input[type="password"]
  78.     {
  79.         width:200px;
  80.         height:35px;        
  81.         margin-right:2px;
  82.         border-radius:3px;
  83.         border:1px solid red;
  84.         padding:5x;
  85.     }
  86.  
  87.     input[type="button"]
  88.     {
  89.         background:none;
  90.         color:white;
  91.         border:none;
  92.         width:110px;
  93.         height:36px;
  94.         border-radius:3px;
  95.         background-color:green;
  96.         font-size:16px;
  97.     }
  98.     </style>
  99. </head>
  100.  
  101. <body>
  102.     <script>
  103.         // intro
  104.         document.write("This text shows up centered on screen....");
  105.  
  106.     </script>
  107.     <div id="wrapper">
  108.         <div id="field_div">
  109.             <input type="text" value="Username" name="uName" id="uName">
  110.             <br>
  111.             <input type="password" value="" name="pass" id="pass" onkeydown="if (event.keyCode == 13) document.getElementById('btnLogin').click()">
  112.             <br><br>
  113.             <input type="button" value="Login" name="btnLogin" id="btnLogin" onclick="buttonClicked(document.getElementById('uName').value, document.getElementById('pass').value)">
  114.             <input type="button" value="Register" onclick="registerUser()">
  115.         </div>
  116.     </div>
  117.  
  118. </body>
  119.  
  120. </html
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement