Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion backend/forms.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ There are various native field types that can be used for the **type** setting.
- [Range](#range)
- [Section](#section)
- [Switch](#switch)
- [Tel](#tel)
- [Text](#text)
- [Textarea](#textarea)
- [Widget](#widget)
Expand Down Expand Up @@ -613,7 +614,6 @@ user_password:
type: password
```

### Radio List

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

Expand Down Expand Up @@ -681,6 +681,35 @@ show_content:
off: myauthor.myplugin::lang.models.mymodel.show_content.off
```

### Tel

`tel` – renders a single-line input for phone values with built-in browser validation.

```yaml
telephone:
label: Phone number
type: tel
pattern: "[0-9]{3}[0-9]{3}[0-9]{4}"
placeholder: xxx-xxx-xxxx
maxlength: 20
minlength: 12
size: 20
required: true
options:
514-123-4567: First Test Phone Number
800-111-2222: Second Test Phone Number
```

- Displays a phone icon on the left in both edit and preview modes.
- In preview mode, renders as a clickable link that opens a phone dialing screen on mobile.
- Supports all standard HTML5 attributes for `<input type="tel">`:
- `placeholder`, `maxlength`, `minlength`, `pattern`, `size`, `list`, `autocomplete`, `required`, `readonly`, `disabled`
- `options` will be rendered in a `<datalist>` element, enabling autocomplete suggestions.
- If an option's value and label are identical, the label is omitted for brevity.

See [Defining field options](#defining-field-options) for the different methods to specify the options.

### Radio List
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate "Radio List" header.

Line 712 contains a duplicate "### Radio List" header that should be removed. The Radio List section is already documented at lines 618-646, and this orphaned header has no content and immediately precedes the Text section.

📝 Proposed fix
-### Radio List
 ### Text

Based on static analysis hints.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Radio List
### Text
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

712-712: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
In `@backend/forms.md` at line 712, Remove the duplicate "### Radio List" header
found in backend/forms.md (the orphaned header at line 712) so the document
doesn't contain two "Radio List" sections; locate the second "### Radio List"
heading that has no content and delete that single header line so the following
"Text" section directly follows the original Radio List content (the Radio List
documented earlier at lines ~618-646).

### Text

`text` - renders a single line text box. This is the default type used if none is specified.
Expand Down