Jump to content

Input boxes


hostfreak

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/26678-input-boxes/
Share on other sites

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
Link to comment
https://forums.phpfreaks.com/topic/26678-input-boxes/#findComment-122056
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.