HTML - Radio Buttons
The radio buttons are used to allow the user to choose one of the listed options. To be able to make this type of form we will firstly need to give a name to every field.
<p>Choose citizenship </p> Rumanian: <input type="radio" name="citizenship" /> English: <input type="radio" name="citizenship" /> Spanish: <input type="radio" name="citizenship" /> |
|---|
Display
Choose citizenship Rumanian: English: Spanish: |
|---|
Specifying a name for the category of which the form is part of we will
let the browser know how to make the difference between more than one radio forms,
therefore allowing the choosing of a single answering variant for each form
Advanced example:
<p>Choose citizenship </p> Rumanian: <input type="radio" name="citizenship" /> English: <input type="radio" name="citizenship" /> Spanish: <input type="radio" name="citizenship" /> <p>Choose sex</p> Man: <input type="radio" name="sex" /> Woman: <input type="radio" name="sex" /> |
|---|
Choose citizenship Rumanian: English: Spanish: Choose sex Man: Woman: |
|---|
HTML - Radio buttons selected 'by default'
Same as with the checkboxes, the radio buttons can be selected to ease the user's work up.
<p> choose citizenship</p> Rumanian: <input type="radio" name="citizenship" checked="yes"/> English: <input type="radio" name="citizenship" /> Spanish: <input type="radio" name="citizenship" />
|
|---|
Display
Choose citizenship Rumanian: English: Spanish: |
|---|
Any of the options can be selected, not necessarily the first. Also, it is good to use this method of selecting certain buttons with moderation and only when the required information is not of major importance. It is possible that the user, out of comfortableness or inattention, to choose the already selected option without it being the correct one for him in that case.
