feat(guide): add guide for HTML value attribute challenge (#35783)

This commit is contained in:
lasjorg
2019-05-03 17:16:50 +02:00
committed by Tom
parent e78b0b868f
commit 7573252fa0

View File

@ -0,0 +1,22 @@
---
title: Use the value attribute with Radio Buttons and Checkboxes
---
## Use the value attribute with Radio Buttons and Checkboxes
To pass the challenge, add the `value` attribute to the `input` elements of type `checkbox` and `radio`. Use the `input` label text, in lowercase, as the value for the attribute. The `value` attribute will make sure the choices are identifiable when the form is submitted.
Example form with value attributes:
```html
<form action="/submit-sandwich">
<label><input type="radio" name="bread" value="wheat"> Wheat</label>
<label><input type="radio" name="bread" value="ciabatta"> Ciabatta</label><br>
<label><input type="checkbox" name="fillings" value="chicken"> Chicken</label>
<label><input type="checkbox" name="fillings" value="tuna"> Tuna</label>
<label><input type="checkbox" name="fillings" value="mayo"> Mayo</label><br>
<textarea placeholder="Allergies, and extra information"></textarea><br>
<button type="submit">Order Sandwich</button>
</form>
```