I have a form called CustInfo. In this form I have 3 text boxes (phone_1, phone_2, and phone_3). I figured out how after the first 3 digits (area code) I can automatically move to the next text box (phone_2). The issue is if I do a Shift-Tab it doesn't stay. Anyone know how to set it so it stays?
Here is some of my page info below.
phone_1 html tag is:
phone_2 html tag is:Code:<input name="phone_1" type="text" onKeyUp="fnMoveNext(this, 'phone_2', 3, event);" size="3" maxlength="3">
phone_3 html tag is:Code:<input name="phone_2" type="text" onKeyUp="fnMoveNext(this, 'phone_3', 3, event);" size="3" maxlength="3">
javascript function is:Code:<input name="phone_3" type="text" size="3" maxlength="3">
Code:function fnMoveNext(obj, name, iMax, evt){ var vItemLen = obj.value.length; var charCode = (evt.which) ? evt.which : event.keyCode if (vItemLen == iMax) { if (charCode != 16){ eval("document.CustInfo." + name + ".focus()"); } } }




Reply With Quote