automatically move cursor from one text box to another

javascript, moving cursor

by Vetrivel Samidurai

HTML

<input type="text" size="2" id="firstID" maxlength="2" onkeyup="movecursor(this,'nextID')"/>
<input type="text" size="5" id="nextID" maxlength="5" onkeyup="movecursor(this,'nextID1')"/> 
<input type="text" size="5" id="nextID1" maxlength="5" />

JavaScript

function movecursor(field,nextField)
{
//alert(nextField);
if(field.value.length >= field.maxLength)
{
document.getElementById(nextField).focus();

}

}