ted_chou12 Posted June 6, 2009 Share Posted June 6, 2009 Hi, for example like a phone number field, if you set the first input field to max of 3, and after finish filling the three, the auto tab proceeds on to filling the rest of the phone number so you don't have to press tab or use mouse to click, is that possible? and how do you do it? Thanks, Ted Quote Link to comment Share on other sites More sharing options...
nitin Posted June 6, 2009 Share Posted June 6, 2009 by using some java script you can easily achieve this goad. <input type="text" onkeyup="SetTelephoneFocus(this,1,1);" id="txtBusinessPhone11" maxlength="3" name="txtBusinessPhone11" /> <input type="text" onkeyup="SetTelephoneFocus(this,1,2);"id="txtBusinessPhone21" maxlength="3" name="txtBusinessPhone21" /> <input type="text" id="txtBusinessPhone31" maxlength="4" name="txtBusinessPhone31"/> <script type="text/javascript"> function SetTelephoneFocus(otype, location, position) { var slen = otype.value; if(slen.length ==3) { if (position==1) { //set to snd postion document.getElementById("txtBusinessPhone2"+location).focus(); } else if (position==2) { //set to third position document.getElementById("txtBusinessPhone3"+location).focus(); } } } </script> Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted June 9, 2009 Author Share Posted June 9, 2009 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.