ich habe ein problem mit einem javascript nummernpad das als login dienen soll.
meine frage ist welche funktion hat :
code=code*10+number
mul=mul*number
document.codepad.thecode.value=code
und was müsste man tippen das mul gleich 12 ergibt ?
Code:
<html> <head> <meta name="robots" content="noindex,nofollow"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#000000" text="red"> <p> </p> <center> <h1>SECURITY LEVEL 12</h1> </center> <p> </p> <center> <br> <br> <p> <script language="JavaScript"> var usermulcode=12 var code=0 var mul=1 var digit=0 var fails=0 function Enter_code(number) { code=code*10+number mul=mul*number document.codepad.thecode.value=code digit++ if (digit==4) { if (mul==12) { location=code+".htm" } else { fails++ code=0 mul=1 digit=0 if (fails<4) { if (fails==1) {document.codepad.thecode.value="failed login #1"} if (fails==2) {document.codepad.thecode.value="failed login #2"} if (fails==3) {document.codepad.thecode.value="failed login #3"} } else { alert("ACCESS DENIED"); alert(document.codepad.thecode.value) } } } } function keycodepad(mulcode) { usermulcode=mulcode document.write("<form name=\"codepad\">"); document.write("<input type=\"button\" value=\" 1 \" onClick=\"Enter_code(1)\">"); document.write("<input type=\"button\" value=\" 2 \" onClick=\"Enter_code(2)\">"); document.write("<input type=\"button\" value=\" 3 \" onClick=\"Enter_code(3)\"><br>"); document.write("<input type=\"button\" value=\" 4 \" onClick=\"Enter_code(4)\">"); document.write("<input type=\"button\" value=\" 5 \" onClick=\"Enter_code(5)\">"); document.write("<input type=\"button\" value=\" 6 \" onClick=\"Enter_code(6)\"><br>"); document.write("<input type=\"button\" value=\" 7 \" onClick=\"Enter_code(7)\">"); document.write("<input type=\"button\" value=\" 8 \" onClick=\"Enter_code(8)\">"); document.write("<input type=\"button\" value=\" 9 \" onClick=\"Enter_code(9)\"><br><br>"); document.write("<input type=\"text\" name=\"thecode\" size=30 value=\"\"><br>"); document.write("</form>"); } </script> </p> <div align="center"> <script> keycodepad(24) </script> </div> </center> </body> </html>
code=code*10+number
mul=mul*number
document.codepad.thecode.value=code
und was müsste man tippen das mul gleich 12 ergibt ?
Kommentar