Example. You couldn't use type="number" because it only allowed for whole numbers. HTML5 is a great leap forward, one of the many improvements is form control. Number Input Alternatives iOS Solution: Use the `pattern` Attribute on a Text Input. It works by matching the input value against a regular expression. According to W3C specifications, you need to also add the step … An HTML form with an input field that can contain only three letters (no numbers or special characters):