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: Add `bind:group` to each input:
```html ```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... 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,7 +27,7 @@ let menu = [
{#each menu as flavour} {#each menu as flavour}
<label> <label>
<input type=checkbox bind:group={flavours} value={flavour}> <input type=checkbox bind:group={flavours} name="flavours" value={flavour}>
{flavour} {flavour}
</label> </label>
{/each} {/each}

Loading…
Cancel
Save