Advanced inputs · SU-319
A phone field takes what is typed and says why it is asked
Flip between the version shibroUI flags and the one it ships. The marks and callouts show what changes.
-
Pasted +44 7700 900982
mangled by the mask
-
Country picker
GB +44 · searchable
Delivery · Step 2 of 3
Where can the courier reach you?
Mobile number
Continue
(440) 770-0900
Enter a valid phone number
Delivery · Step 2 of 3
Where can the courier reach you?
Mobile number
Continue
GB+4407700 900982
We only text you about delivery. Optional.
-
Error
a valid UK number fails
-
Number field
as typed · 20ch -
Why we ask
in the hint · optional
What changes
- Bad
- A US-style mask with no country picker: pasting
+44 7700 900982becomes(440) 770-0900and fails withEnter a valid phone number. - Good
- A searchable
GB +44country picker and a free20chfield holding07700 900982as typed, with the hintWe only text you about delivery. Optional.
The rules
-
SU-319
Phone fields accept what people type and explain the request. Use
type="tel"withautocomplete="tel"and accept spaces, hyphens, brackets and a leading "+"; never mask while typing. Put a searchable country picker (name plus dial code, defaulted from the locale) to the left of the number, validate with a phone library on blur, and say why the number is wanted or make it optional. Width about 20ch.