I have a form that only takes in numbers as it represents a dollar amount. Currently, the form only accepts numerical keystrokes. Is this good practise?
Answer
Yes, I would say that you should only accept characters appropriate to the field. If it's a phone number, you should also accept characters like: ()-+.
However, you should let the person know that an invalid key was pressed rather than do nothing. Otherwise you may end up frustrating them. Examples include: a small error message that pops up next to the field and then fades out; or simply changing the border colour to red before fading it back again.
No comments:
Post a Comment