Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Constraining input text to one character
May 25, 2005, 3:09 am
rate this thread
Is it possible to force an input box to a single character?
What i want is to have a user type a single character in to an input
box. If he types more letter, then I want the following letters to
either be ignored or automatically move to different input box.
I could use a select box, but find the down arrow distracting in
The drop down list also gets a bit long that way since it could be A
Re: Constraining input text to one character
On Wed, 24 May 2005, Keith wrote:
You can specify maxlength. But a mischievous user could override
that, so your server-side process must not assume that the max length
has been policed - you need to check it in the server-side process
You don't get this amount of detailed control over the browser in
do anything for users who have js unimplemented, or disabled from
Otherwise you'll just get each browser's default behaviour when the
maxlength is reached/exceeded. IMHO you'd be entitled to assume
that each user can cope with whatever their browser does for them.