hii
please add javascript function in textbox key pressed event and maintain
textbox focus base on maxlength
Example
<asp:TextBox ID="txt1" MaxLength="4" runat="server" onkeypress="myFunction(event)" ></asp:TextBox>
<asp:TextBox ID="txt2" MaxLength="4" runat="server"></asp:TextBox>
<script type="text/javascript" >
function myFunction(event) {
var str = document.getElementById('<%=txt1.ClientID%>').value;
if (event.keyCode == 8) {
document.getElementById('<%=txt1.ClientID%>').focus();
}
else if (str.length == 4) {
document.getElementById('<%=txt2.ClientID%>').focus();
}
else { }
}
</script>
here we have used keycode 8 for backspace
check it