Does this help you?
HTML Code:
<html>
<head>
<title>KeyPad Combination</title>
</head>
<body onLoad="generateKeypad(false)">
<script type="text/javascript">
var combination = "";
var disabled = "";
var innerR = "";
function includeNum(self){
combination += self.value;
if(combination.length == 3){
disabled="disabled";
generateKeypad(true);
switch(combination)
{
case "123":
window.location="http://google.com";
break;
case "890":
window.location="http://dynamicdrive.com";
break;
default:
window.location="http://yahoo.com";
}
}
}
function generateKeypad(){
innerR = "";
for(i=1;i<=3;i++){
innerR += '<button onClick="includeNum(this)" value="'+i+'" '+disabled+'>'+i+'</button>';
}
innerR += '<br />';
for(i=4;i<=6;i++){
innerR += '<button onClick="includeNum(this)" value="'+i+'" '+disabled+'>'+i+'</button>';
}
innerR += '<br />';
for(i=7;i<=9;i++){
innerR += '<button onClick="includeNum(this)" value="'+i+'" '+disabled+'>'+i+'</button>';
}
innerR += '<br /><button onClick="includeNum(this)" value="0" '+disabled+'>0</button>';
document.getElementById('keypad').innerHTML=innerR;
}
</script>
<div id="keypad">null</div>
</body>
</html>
I think that there are 3486784401 possible combinations. To add a new combination, before:
Code:
default:
window.location="http://yahoo.com";
Add:
Code:
case "digit":
window.location="website.com";
break;
Replace the red with the three digit number, and the blue with the site. To change the ones that I already put in, I think you can figure out by what I gave you above.
If you can't. Just post.
Bookmarks