scenario: form validation

I ask myself the question: in a special input form for postcode for example, in which only numbers (integer) are allowed. In a usability view I would say, you should be allowed to input all keys (abcd, 1234), the logic should fit it in the background. Would you forbid and deactivate alphanumeric keys, that the user cannot put the wrong keys into the input field? I think the user would be confused. What is your opinion?

The HTML-Input for numbers: no way. It is a desktop application on Windows.

Thank you!

2 Answers 2


Yes, don‘t prevent users from typing certain characters in fields because it makes the input (or the user's keyboard) appear broken.

Users don‘t always look at the screen while typing, so it would be especially frustrating if they typed a thing, to look up and find that what they typed doesn't appear.

Better to let the user input what they want, forgive as much as possible (extra spaces, dashes, slashes) and present a clear error message instead.

This is part of the problem with the HTML5 number input which has a whole host of problems.

  • thanks for your comment. Thats the way I think. But good to know your thinking about it.
    – alex123456
    Commented May 28, 2020 at 12:38

If your input has constraints which it will enforce at some point, ie by rejecting the form, it's best to communicate the constraints early.

Examples of this abound, including ZIP codes, phone numbers and password requirements.

Two possibilities to communicate the constraints before the input would be placeholder and, well, simply a hint/info box. Then, let the user enter whatever he desires, but validate the input in a timely manner, eg before the user focusses his attention on the next field. Invalid feedback usually styles the input field and displays the "error" next to the field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.