Skip to content

Commit 77e1e03

Browse files
authored
Merge pull request #688 from ExpressionEngine/feature/7.x/passthrough-html-form-attrs
Enabled passing through valid HTML form attributes to forms in ExpressionEngine as tag parameters
2 parents b0424fd + f1f4668 commit 77e1e03

File tree

15 files changed

+33
-2
lines changed

15 files changed

+33
-2
lines changed

docs/_tips/form-attributes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
TIP: Valid HTML Form attributes (as listed in the [config file](config/config-files.md#html-form-attributes)), `data-` and `aria-` attributes passed through ExpressionEngine tag parameters in the template will be included into generated opening form tag.

docs/add-ons/consent.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Consent Forms allow the visitor to grant or withdraw consent to one or more Cons
4040

4141
[TOC=3]
4242

43+
{{embed:_tips/form-attributes.md}}
44+
4345
#### `consent=`
4446

4547
consent='ee:cookies_functionality'

docs/add-ons/email.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ The contact form is created similar to a standard web form, only you **do not**
5656

5757
[TOC=3]
5858

59+
{{embed:_tips/form-attributes.md}}
60+
5961
### `charset=`
6062

6163
charset="utf-8"

docs/add-ons/search/advanced.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ The search results are displayed on the page you specify as the [result_page=](#
143143

144144
[TOC=3]
145145

146+
{{embed:_tips/form-attributes.md}}
147+
146148
### `category=`
147149

148150
category="1"

docs/add-ons/search/simple.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Besides specifying whether future entries are included in the search using the [
7373

7474
## Parameters
7575

76+
{{embed:_tips/form-attributes.md}}
77+
7678
### `name=`
7779

7880
name="search_form"

docs/channels/channel-form/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ By default, validation errors will be displayed using the User Message Template.
6161

6262
[TOC=3 hide]
6363

64+
{{embed:_tips/form-attributes.md}}
65+
6466
The Following parameters are available for the `{exp:channel:form}`:
6567

6668
### `allow_comments=`

docs/comment/form.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ TIP: **Tip:** Notice the variables in the "value" form fields? These allow us to
5252

5353
[TOC=4]
5454

55+
{{embed:_tips/form-attributes.md}}
56+
5557
#### `entry_id=`
5658

5759
entry_id="24"

docs/config/config-files.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ The list of the words that are being used to generate [CAPTCHA](security/captcha
2929

3030
This file contains an array of foreign characters for transliteration conversion used by the Text helper (example would be generating URL Titles for entries).
3131

32+
#### HTML Form Attributes
33+
34+
`valid_form_attributes.php`
35+
36+
A list of HTML attributes that are allowed to be passed via EE template tag parameters to the `form` tag when creating forms with `ee()->functions->form_declaration()`. Additionally, attributes prefixed with `data-` and `aria-` can be used.
37+
3238
#### Allowed Mime Types
3339

3440
`mimes.php`

docs/development/legacy/libraries/functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ Any form will accept the `form_class` and `form_id` parameters. Access the value
126126

127127
$r = ee()->functions->form_declaration($form_details);
128128

129+
{{embed:_tips/form-attributes.md}}
130+
129131
### `form_backtrack([$offset = ''])`
130132

131133
| Parameter | Type | Description |

docs/member/edit-avatar.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This tag allows users to edit their avatar image. The image will be uploaded to
2020

2121
## Parameters
2222

23+
{{embed:_tips/form-attributes.md}}
24+
2325
### `return=`
2426

2527
return="member/profile"

0 commit comments

Comments
 (0)