Combo Box

Combo Box called another drop-down menu, one of the flexible and user-friendly form elements. Depending on the settings in the list can choose one or more values. The advantage of the list in its compactness, it can take only one line, but to see the full list need to click on it. However, this is a disadvantage, because the user does not immediately see the whole selection.

combo box is created as follows.

<Select Options>
<Option settings> Option 1 </ option>
<Option> Option 2 </ option>
<Option> Option 3 </ option>
</ Select>

Tags <SELECT> and <OPTION> has the following parameters (Table. 1).

Table. 1. The parameters of the field with the list
Parameter
select
Description
name Name field. It is intended to form handler can identify the list.
size The number of visible rows. By default, one line.
multiple This option allows you to select multiple rows. The choice is made using the Control or Shift key.
parameter option Description
selected Default Visible field.
value Determines the value to be sent to the server with the selected list item.

Create a list using the tag <SELECT> and <OPTION> is shown in Example 1.

Example 1. Combo Box

valid HTML
<DOCTYPE HTML PUBLIC! "- // W3C // DTD HTML 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Combo Box </ title>
</ Head>
<Body>

<Form action = "/ cgi-bin / handler.cgi">
<P> <b> How do you think stands for the abbreviation "OS"? </ B> </ p>
<P> <select name = "OS">
<Option> Officers </ option>
<Option> Operating System </ option>
<Option> Big striped flies </ option>
</ Select> </ p>
</ Form>

</ Body>
</ Html>

As a result, we obtain the following (see Fig. 1).

Fig. 1

Fig. 1. View the list disclosed

© Policy Copyright www.htmlbook.ru