Skip to content

Commit f30e563

Browse files
committed
Update documentation for input checkbox arrays
1 parent 8d54aae commit f30e563

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/wiki/API-Form-Elements.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,16 @@ Resources:
330330
<input type="checkbox" name="checkbox" value="value" />
331331
```
332332

333+
Input arrays are supported. The following will return an array `['cars'=>['audi', 'bmw']]`.
334+
335+
```html
336+
<form action="/" method="post">
337+
<input type="checkbox" name="cars[]" value="audi" checked />
338+
<input type="checkbox" name="cars[]" value="bmw" checked />
339+
<input type="checkbox" name="cars[]" value="volkswagen" />
340+
</form>
341+
```
342+
333343
Resources:
334344
[whatwg](https://html.spec.whatwg.org/multipage/forms.html#checkbox-state-(type=checkbox))
335345

0 commit comments

Comments
 (0)