Checkbox
Flags are used when it is necessary to choose two or more variants from the offered ones. If you want to select only one option, then you should prefer the switches (radiobutton).
The check box is created as follows.
Field parameters are listed in Table. 1.
Parameter | Description |
---|---|
Name | The name of the field. It is intended for the form handler to be able to identify this field. |
Value | The value of the field determines what will be sent to the server when the checkmark is ticked. |
Checked | If this parameter is checked, a check mark in the field will be added automatically. |
The creation and use of the checkboxes is shown in Example 1. Note that the value of each flag in the group is different. So the server program can determine which item was flagged.
Example 1. Using the checkboxes
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Checkboxes </ title>
</ Head>
<Body>
<Form action = "/ cgi-bin / handler.cgi">
<P> <b> What operating systems are you familiar with? </ B> </ p>
<P> <input type = "checkbox" name = "option1" value = "a1" checked> Windows 95/98 </ p>
<P> <input type = "checkbox" name = "option2" value = "a2"> Windows 2000 </ p>
<P> <input type = "checkbox" name = "option3" value = "a3"> System X </ p>
<P> <input type = "checkbox" name = "option4" value = "a4"> Linux </ p>
<P> <input type = "checkbox" name = "option5" value = "a5"> X3-DOS </ p>
</ Form>
</ Html>
The result of this example is shown in Fig. 1.
Fig. 1. Kind of checkboxes in the Opera browser
Copyright © www.htmlbook.ru
Comments
When commenting on, remember that the content and tone of your message can hurt the feelings of real people, show respect and tolerance to your interlocutors even if you do not share their opinion, your behavior in the conditions of freedom of expression and anonymity provided by the Internet, changes Not only virtual, but also the real world. All comments are hidden from the index, spam is controlled.