Posts

Showing posts from August, 2012

Phone Number Auto Increment Decrement Focus

Following Jquery functions are used to set focus on text box on max length and set focus to prev text box on click of backspace when length gets zero. $(function () { $('.phoneText,.AlternatePhoneText,.FaxText').keyup(function (e) { if (e.which == 8) { if ($(this).val().length == 0)  $(this).prev(':input').focus(); } else { if ($(this).val().length == $(this).attr('maxlength'))  $(this).next(':input').focus(); } }) })