Following code moves the cursor from one textbox to next once it meets the maxlength criteria. Following code works very well in Chrome. For the first textbox max length is 3 so cursor automatically moves to next textbox. But do not understand why in internet explorer it does not do so. Please help, I am missing the important delivery date. Please note that 'mobNum' is the class of those textboxes
$('.mobNum').keypress(function(evt) {
debugger;
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
$("#msgMobileValidation").text("");
$("#divClientValidMobile").hide();
var idStr = $(this).attr('id').split('_')[0];
var idCnt = $(this).attr('id').split('_')[1];
var nextIdCnt = parseInt(idCnt) + 1;
nextIdCnt = nextIdCnt.toString();
var nextControlId = "#" + idStr + "_" + nextIdCnt;
var strLength = this.value.length + 1;
var limit = parseInt($(this).attr('maxlength'));
if (strLength == limit) {
//$(nextControlId).focus();
document.getElementById(nextControlId).focus();
}
});