Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Javascript - Forms</title>
- <script type="text/javascript">
- function test() {
- var userName = document.forms[0].elements[0].value;
- var password = document.forms[0].elements[1].value;
- var x = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
- var y = new Date();
- var h = y.getHours();
- var brake_it = h + 10;
- var crack_it = h - 21
- x.reverse();
- for (i=0;i<=5;i++) {
- x.pop(x[i]);
- x.push(h);
- }
- var combination = x[0] + brake_it;
- var combination1 = x[0] + crack_it;
- if ((userName==combination) && (password==combination1)) {
- alert("You are right, thats the combination :)");
- }
- }
- </script>
- </head>
- <body>
- <form>
- Username:<input type="text" />
- Password:<input type="text" />
- <input type="button" value="Click me" onClick="test();" />
- </form>
- </body>
- </html>
Add Comment
Please, Sign In to add comment