HTML Basic
HTML form Checkboxes
HTML form Checkboxes are used as checkboxes in the form ( HTML form ). When you decide to give a netizen many options to choose, for example, when registering a member, check his interests. You can select only one item or multiple items. Even if you don’t check it, after submitting the form, you can use PHP to get the item selected by the netizen.
HTML form Checkboxes example
<form>
Please tick your interest<br>
<input type="checkbox" value="Travel" name="Interest"> Travel<br>
<input type="checkbox" value="Movie" name="Interest "> Movie<br>
<input type="checkbox" value="Food" name="Interest"> Food
</form>
The results are presented asPlease tick your interest<br>
<input type="checkbox" value="Travel" name="Interest"> Travel<br>
<input type="checkbox" value="Movie" name="Interest "> Movie<br>
<input type="checkbox" value="Food" name="Interest"> Food
</form>
As mentioned at the beginning, the checkbox is used in the application of the form, so in the example, we use the form tag <form></form> to wrap the three checkbox options. In addition to the form, you can also use the checkbox In other JavaScript applications, but that requires other JavaScript syntax skills, it is beyond the scope of this article.
Each checkbox in the example has the same name, so we can easily group the three checkboxes into a group, and the value of each checkbox is different. After the netizens have checked their interests and sent the form , The PHP program can determine which ones are checked and which ones are not checked.
Post a Comment
0 Comments