Last active
August 29, 2015 14:26
-
-
Save adamsilver/3673f34c49866c373dec to your computer and use it in GitHub Desktop.
forms for the kids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="groupControl"> | |
<div class="indicator">Favourite things</div> | |
<fieldset> | |
<legend>Gender</legend> | |
<div class="control firstControl"> | |
<input type="checkbox" class="checkbox" value="male" name="thing" id="thing"> | |
<label for="thing">Thing</label> | |
</div> | |
<div class="control"> | |
<input type="checkbox" class="checkbox" value="female" name="thing" id="thing1"> | |
<label for="thing1">Thing 2</label> | |
</div> | |
<div class="control"> | |
<input type="checkbox" class="checkbox" value="other" name="thing" id="thing2"> | |
<label for="thing2">Thing 3</label> | |
</div> | |
</fieldset> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="groupControl"> | |
<div class="indicator">Gender</div> | |
<fieldset> | |
<legend>Gender</legend> | |
<div class="control firstControl"> | |
<input type="radio" class="radio" value="male" name="gender" id="gender"> | |
<label for="gender">Male</label> | |
</div> | |
<div class="control"> | |
<input type="radio" class="radio" value="female" name="gender" id="gender1"> | |
<label for="gender1">Female</label> | |
</div> | |
<div class="control"> | |
<input type="radio" class="radio" value="other" name="gender" id="gender2"> | |
<label for="gender2">Other WTF?</label> | |
</div> | |
</fieldset> | |
</div> | |
<!-- | |
Notes: | |
1. The `id` of the first radio control MATCHES the `name` of the radio control | |
2. All radio controls within the same group have the same `name` | |
3. The `for` attribute for the label matches the id of the corresponding radio control | |
4. All subsequent radio controls have suffixed `id` attributes and again the label `for` attribute matches | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment