So I've got a large form in a web application, and currently the textboxes (inputs) that accept string values look exactly the same as those that require integer values. Form validation prevents the user from entering a string into the integer textboxes, but it feels like the user should be informed of this requirement when they first view the form.

Is my thought process here correct, and if so, what is the best way to inform the user that integer values must be inputted into certain textboxes?

Here are some ideas I had:

  • Detail this requirement as a placeholder/watermark in the textbox. What would it say, however? It seems like most statements would be clunky at best: "Enter an integer" (does the user know what an integer is?), "Numbers only" (the user might enter a decimal number).

  • Include some wording next to the textbox (same problems as with placeholder, also will clutter up the form)

  • Set the input as type="number". In Chrome, this results in up/down arrows automatically rendered inside the textbox. In Internet Explorer 11, however, no such visible cues are shown.

What do you think?

  • What do the values represent/stipulate/control?
    – Confused
    Commented Dec 1, 2016 at 15:12
  • What is the label for the integer field, and what is the range of numbers that will be entered?
    – SteveD
    Commented Dec 1, 2016 at 15:47
  • X.0 for your watermark ?
    – PhillipW
    Commented Dec 1, 2016 at 16:14
  • Are there minimum and maximum accepted values for the field? If so, a tooltip of the form "Enter a number from 1-100" may help. Additionally, rather than form validation, you could potentially apply some code to the field to prevent all characters other than 0-9 at runtime. Commented Dec 5, 2016 at 13:59

1 Answer 1


Set the input type to number as the browser will add some extra functionality, and some touch keyboards will display specially for numbers.

Some ideas could be:

  • Display an example of a valid input in the placeholder relevant to the field or set a default value to the input (for example 0)
  • Include some specification in the label that there should be numbers in the input
  • Restrict the input content to numbers only
  • If relevant think of using a slider as-well-as/instead of the input
  • Add more information in a tooltip

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.