Wednesday, March 4, 2015

forms - Is it good practice to only accept numeric keystrokes in number-only fields?


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

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...