Skip to content

Commit 195c985

Browse files
committed
document phone form field
1 parent c2734e2 commit 195c985

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

backend/forms.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,34 @@ user_password:
613613
type: password
614614
```
615615

616+
### Phone
617+
618+
`phone` – renders a single-line input for phone values with built-in browser validation.
619+
620+
```yaml
621+
telephone:
622+
label: Phone number
623+
type: phone
624+
pattern: "[0-9]{3}[0-9]{3}[0-9]{4}"
625+
placeholder: xxx-xxx-xxxx
626+
maxlength: 20
627+
minlength: 12
628+
size: 20
629+
required: true
630+
options:
631+
514-123-4567: First Test Phone Number
632+
800-111-2222: Second Test Phone Number
633+
```
634+
635+
- Displays a phone icon on the left in both edit and preview modes.
636+
- In preview mode, renders as a clickable link that opens a phone dialing screen on mobile.
637+
- Supports all standard HTML5 attributes for `<input type="tel">`:
638+
- `placeholder`, `maxlength`, `minlength`, `pattern`, `size`, `list`, `autocomplete`, `required`, `readonly`, `disabled`
639+
- `options` will be rendered in a `<datalist>` element, enabling autocomplete suggestions.
640+
- If an option's value and label are identical, the label is omitted for brevity.
641+
642+
See [Defining field options](#defining-field-options) for the different methods to specify the options.
643+
616644
### Radio List
617645

618646
`radio` - renders a list of radio options, where only one item can be selected at a time.

0 commit comments

Comments
 (0)