📱 Number Field Shows Number Keyboard
type=’number’ has spinner buttons. type=’tel’ shows number keyboard but no spinner. inputmode controls keyboard without changing validation.
📝 Input Mode Values
<!-- Numeric keyboard (no spinner) --> <input type='text' inputmode='numeric' placeholder='Age'> <!-- Decimal keyboard (with dot) --> <input type='text' inputmode='decimal' placeholder='Price'> <!-- Email keyboard (@ and .com) --> <input type='email' inputmode='email'> <!-- URL keyboard (/ and .com) --> <input type='url' inputmode='url'> <!-- Search keyboard (search icon) --> <input type='search' inputmode='search'> <!-- Telephone keyboard (number pad) --> <input type='tel' inputmode='tel'> <!-- No keyboard (for special inputs) --> <input inputmode='none'>
✅ Best Practices
- Use ‘numeric’ for quantities, ages, years (no spinner)
- Use ‘decimal’ for prices, measurements (includes decimal point)
- Use ’email’ for email fields (adds @ and .com keys)
- Use ‘tel’ for phone numbers (number pad)
- Never use type=’number’ for things like credit cards (spinner is annoying)
“Mobile users hated spinner buttons for credit cards. Switched to inputmode=’numeric’. Same number keyboard, no spinners. Better UX in 2 minutes.”
