hostfreak Posted November 9, 2006 Share Posted November 9, 2006 I am not 100% sure if this should be done in javascript or if it can be done in css. Anyways, say I have 2 input boxes for someone to type in there first and last name initials. I need to limit the input boxes to 1 character. Then if the character is type, it will switch to the next input (as it would if you used the tab button). In this case, the person types in there first name initial and it automatically jumps to the last name initials so they can type. Any ideas on where to look, help etc is greatly appreciated. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Vikas Jayna Posted November 9, 2006 Share Posted November 9, 2006 The character length can be limited using [b]maxlength=1[/b] in the input tag i.e. [code]<input type="text" maxlength="1" name="xyz">[/code]Also, the focus can be shifted to the second textbox by using the [b]OnChange()[/b] property on the first textbox Quote Link to comment Share on other sites More sharing options...
hostfreak Posted November 9, 2006 Author Share Posted November 9, 2006 Ah, thanks Vikas. I knew about the maxlength, just wasn't sure what to do for the javascript until now. Thanks again. 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.