Update text.md

Missing `name` attribute in form groups
pull/5649/head
Nguyễn Đức Hào 5 years ago committed by GitHub
parent 80300f9702
commit 7971e62c4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,7 @@ If you have multiple inputs relating to the same value, you can use `bind:group`
Add `bind:group` to each input:
```html
<input type=radio bind:group={scoops} value={1}>
<input type=radio bind:group={scoops} name="scoops" value={1}>
```
In this case, we could make the code simpler by moving the checkbox inputs into an `each` block. First, add a `menu` variable to the `<script>` block...
@ -27,10 +27,10 @@ let menu = [
{#each menu as flavour}
<label>
<input type=checkbox bind:group={flavours} value={flavour}>
<input type=checkbox bind:group={flavours} name="flavours" value={flavour}>
{flavour}
</label>
{/each}
```
It's now easy to expand our ice cream menu in new and exciting directions.
It's now easy to expand our ice cream menu in new and exciting directions.

Loading…
Cancel
Save