You might know it from several games such as Diablo 2. You have to write down your cd product key in 3 different input boxes, and it varies in length e.g. first box has 4 numbers, second has 3 and last has only 2.
Then when you’re finished writing down your 9 numbers it will automatic change focus to the submit button.
You can do that in JavaScript, if you have an activation code or something else on your webpage, and it's quite simple to actually.
Place this code in your
head section on your page:
Code:
<script type="text/javascript">
function toUnicode(elmnt,content)
{
if (content.length==elmnt.maxLength)
{
next=elmnt.tabIndex
if (next<document.forms[0].elements.length)
{
document.forms[0].elements[next].focus()
}
}
}
</script>
Place this HTML code in your
body:
Code:
<form name="form" form methode="post" value="active.asp">
<input size="4" tabindex="1" name="first"
maxlength="4" onkeyup="toUnicode(this,this.value)">
<input size="3" tabindex="2" name="Second"
maxlength="3" onkeyup="toUnicode(this,this.value)">
<input size="2" tabindex="3" name="Third"
maxlength="2" onkeyup="toUnicode(this,this.value)">
<br>
<br>
<input type="submit" name="submit" value="submit"
</form>