Planet For Application Life Development Presents
MY IT World

Explore and uptodate your technology skills...

HTML - Select

HTML - Select Fields

HTML select fields provide essentially the same functionality as HTML Checkbox Fields. They allow the user to select one or more values from a pre-determined series of options.

Incorporating a select field into a web page is done using the <select> tag. List values are then added to the field using the <option> tag, similar to how list items <li> are added to ordered list elements (<ol>).

HTML Drop Down List

<select name="selectionField"> 
  <option value="CA" >Channai -- CA </option>
  <option value="CO" >Calcuta -- CO</option>
  <option value="CN" >Chandigarh -- CN</option>
</select>

HTML Drop Down List

By default, select fields, popularly called drop down lists, only allow the user to choose a single value. This behavior and appearance may be changed by adjusting the multiple and size attributes as demonstrated below.

HTML - Disabling Selection Fields

Disabling a selection field is achieved by setting the disabled attribute to "yes". But before doing that, you should set at least one of the values to be selected. Doing so renders a read-only selection field on the page that can inform your users of their selections without allowing them to alter the selection.