I have some code for you
js
function move(txt) {
var value = txt.value;
var length = txt.value.length
if (length == 0) {
$(txt).prev().focus();
return false;
}
else if (length > 4) {
$(txt).next().focus().val(value.substr(4, 1));
$(txt).val(value.substr(0, 4));
return false;
}
}
html
<asp:textbox runat="server" id="TextBox1" onkeyup="javascript:return move(this)" xmlns:asp="#unknown"></asp:textbox>
<asp:textbox runat="server" id="TextBox2" onkeyup="javascript:return move(this)" xmlns:asp="#unknown"></asp:textbox>
<asp:textbox runat="server" id="TextBox3" onkeyup="javascript:return move(this)" xmlns:asp="#unknown"></asp:textbox>
<asp:textbox runat="server" id="TextBox4" onkeyup="javascript:return move(this)" xmlns:asp="#unknown"></asp:textbox>
Hope this helps