HTML form element – Radio button
Here is an example:
1 2 3
<input type="radio" name="number" value="1"> one <input type="radio" name="number" value="2"> two <input type="radio" name="number" value="3"> three
Remember to give them the same name to indicate that they are all belong to the same set of radio button.
Attributes for the radio button:
- name: to give the radio button set a name.
- type: to indicates that it is a radio button, by using “type=”radio””.
- value: the value which will send to a PHP file for processing after being submit, please aware that this is different from the text display.
Please notice that only 1 choice can be selected in a set of radio button.