A pull down menu lets the user select one choice out of many possible choices. One nice aspect of pull-down menus is that all choices do not have to be seen on the screen and are normally hidden. They occupy minimal amount of space as it displays only on item of the list. In this kind of input field you use <SELECT>instead of <INPUT> and it has a closing tag.
<SELECT name = "text-id" size="n" multiple >
<OPTION Value = "Choice-id" selected> Text Label -1 </OPTION>
<OPTION Value = "Choice id m" selected> TEXT LABEL. - m </OPTION>
Name: To establish a name for the select field and is used for form processing.
Size: The number of options you want to show in the window. By default its value is one, specifying size value greater than one turns the pull down list into a scrolling list. In the SELECT field, by default, the user can select only one field.
Multiple: To set the SELECT field to accept any number of options. To select multiple options press ctrl key and click on the options.
<OPTION> Tag: To include the list items. For each list item there must be an <option> tag "The closing" tag is optional.
Value: Whenever a form is submitted, the options in the pull down list are passed to the form handles using the "Value" attribute. If the "Value" attribute is omitted the contents of the option are used instead.
Selected: This attribute is used to specify the default other than the first option. More than the first option- More than one option can be made default by using this attribute but in that case you just include the multiple attribute, otherwise the last option having selected attribute will be considered as default. The defaults will appear when the form is loaded or reset. The following lines of code will add a pull down list to our sample form.
<HEAD><TITLE> TEXT FIELDS</TITLE></HEAD>
<P ALIGN ="CENTER"><B>ADMISSION FORM</B>
<INPUT TYPE ="TEXT" NAME="NAME" VALUE="ENTER YOUR NAME:" SIZE="25" MAXLENGTH="30"> NAME<BR><BR>
<INPUT TYPE ="PASSWORD" NAME="PASSWD" SIZE="25" MAXLENGTH="30"><BR><BR>
<INPUT TYPE ="TEXT" NAME="ADDRESS" SIZE="25" MAXLENGTH="30">
<INPUT TYPE=”RADIO” NAME=”SEX” VALUE=”MALE” CHECKED>MALE<BR>
<INPUT TYPE=”RADIO” NAME=”SEX” VALUE=”FEMALE” >FEMALE<BR>
<SELECT NAME =”COUNTRY”>
<OPTION VALUE = “INDIA”>INDIA
<OPTION VALUE = “AMERICA”> AMERICA
<OPTION VALUE = “AUSTRALIA”> AUSTRALIA
<OPTION VALUE = “NEW ZEALAND”> NEW ZEALAND
<OPTION VALUE = “CHINA”> CHINA
But if the "multiple" attribute is included, the list will become a scrolling list. This attribute is added in the <SELECT> tag as shown below:
<SELECT NAME="COUNTRY" MULTIPLE>
<OPTION VALUE=" AMERICA" SELECTED>AMERICA
<OPTION VALUE="NEW ZEALAND">NEW ZEALAND