CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmasters (CSS Editor / HTML Editor / CSS Validator / HTML Tutorial)
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersHome
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Editor
SEO Report For Windows - The ultimate website ranking checker / search engine optimization toolkit!SEO Report (New)
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Download
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersOrder
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersSupport
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersNews
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersAwards
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersContact
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersLinks
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersAbout
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Validator
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Tools
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS FAQ
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Tutorial
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Articles
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Resources
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersCSS Layouts
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersHTML Tidy
Style Studio CSS Editor - CSS cascading style sheets made simple with Style Studio, powerful CSS Editor / HTML Editor for professional webmastersHTML Tutorial
   
Home » HTML Tutorial » SELECT - Option Selector


SELECT - Option Selector


Summary

Syntax <SELECT>...</SELECT>
Attribute Specifications
  • NAME=CDATA (key in submitted form)
  • MULTIPLE (allow multiple selections)
  • SIZE=Number (number of visible options)
  • DISABLED (disable element)
  • TABINDEX=Number (position in tabbing order)
  • ONFOCUS=Script (element received focus)
  • ONBLUR=Script (element lost focus)
  • ONCHANGE=Script (element value changed)
  • common attributes
Contents One or more OPTGROUP or OPTION elements
Contained in Block-level elements, inline elements except BUTTON

Details

The SELECT element defines a form control for the selection of options. While SELECT is most useful within a FORM, HTML 4.0 allows SELECT in any block-level or inline element other than BUTTON. However, Netscape Navigator will not display any SELECT elements outside of a FORM.

The SELECT element contains one or more OPTGROUP or OPTION elements to provide a menu of choices for the user. Each choice is contained within an OPTION element. Choices can be grouped logically through the OPTGROUP element. SELECT's NAME attribute provides the key sent to the server with the value of the selected option.

By default, the user can only select one option. The boolean MULTIPLE attribute allows the user to select multiple options, which are submitted as separate name/value pairs. The following example uses the MULTIPLE attribute to allow the selection of one or more options:

<P>Select one or more sections to search:
<SELECT NAME=sections MULTIPLE>
<OPTION>Web Authoring Reference</OPTION>
<OPTION>FAQ Archives</OPTION>
<OPTION>Design Elements</OPTION>
<OPTION>Tools</OPTION>
<OPTION>Feature Article</OPTION>
</SELECT>
</P>

The boolean DISABLED attribute, new in HTML 4.0 and poorly supported by current browsers, makes the SELECT element unavailable. The user is unable to edit the disabled selection, no value is submitted with the form, the SELECT element cannot receive focus, and the element is skipped when navigating the document by tabbing.

The TABINDEX attribute specifies a number between 0 and 32767 to indicate the tabbing order of the element. A SELECT element with TABINDEX=0 or no TABINDEX attribute will be visited after any elements with a positive TABINDEX. Among positive TABINDEX values, the lower number receives focus first. In the case of a tie, the element appearing first in the HTML document takes precedence.

The SIZE attribute of SELECT hints that visual browsers should display the element as a list box with the specified number of options visible at any time. A scroll bar would allow access to any non-visible options. The SIZE attribute is especially useful in SELECT elements with numerous OPTIONs and multiple selections allowed. In such a situation, some visual browsers will render the entire list in one large box without scrolling; a suitable SIZE attribute helps such browsers give a more appropriate presentation.

The SELECT element also takes a number of attributes to specify client-side scripting actions for various events. In addition to the core events common to most elements, SELECT accepts the following event attributes:

  • ONFOCUS, when the element receives focus;
  • ONBLUR, when the element loses focus;
  • ONCHANGE, when the element loses focus and its value has changed since it received focus.

More Information


Adapted by style-sheets.com, maker of Style Studio, powerful CSS Editor for Windows.

Copyright © John Pozadzides and Liam Quinn. All rights reserved.


Home » HTML Tutorial » SELECT - Option Selector

 

Related Links :


Acknowledgements    |    Site Map    |    FAQ    |    Website Ranking Checker    |    HighDots Forums
Copyright OverZone Software 2000-2008. All rights reserved.
DotNET Forums    |    MySQL Forums    |    Java Forums    |    Delphi / C++ Forums    |    Database Forums

html 4.01 | css 2 (W3C) | css 2