home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 133 / dpcs0399.iso / INTERNET / COFFEE / HTMLED55 / SETUP.EXE / file0130.bin < prev    next >
Encoding:
Text File  |  1998-11-04  |  8.1 KB  |  77 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
  2.    "http://www.w3.org/TR/REC-html40/strict.dtd">
  3. <html lang=en>
  4. <head>
  5. <title>SELECT - Option Selector</title>
  6. <link rev=Made href="mailto:liam@htmlhelp.com">
  7. <link rel=Start href="../index.html">
  8. <link rel=Glossary href="http://www.htmlhelp.com/glossary/glossary.html">
  9. <link rel=Copyright href="http://www.htmlhelp.com/copyright.html">
  10. <link rel=StyleSheet href="../style.css" type="text/css">
  11. <link rel=StyleSheet href="../aural.css" type="text/css" media=aural>
  12. <meta name="author" content="Liam Quinn">
  13. <meta name="description" content="A description of HTML 4.0's SELECT element for the selection of options in a form.">
  14. <meta name="keywords" content="SELECT, select element, select box, selection, drop-down list, list box, drop-down menu, forms, form, HyperText Markup Language, HTML, HTML4, HTML 4.0, Web Design Group, WDG, <select> tag, <SELECT> tag">
  15. </head>
  16. <body>
  17. <h2><img src="../wdglogo1.gif" width=250 height=83 alt="The Web Design Group"></h2>
  18. <h1>SELECT - Option Selector</h1>
  19. <table>
  20.   <tr valign=top>
  21.     <th>Syntax</th>
  22.     <td><strong class=required><SELECT></strong>...<strong class=required></SELECT></strong></td>
  23.   </tr>
  24.   <tr valign=top>
  25.     <th>Attribute Specifications</th>
  26.     <td>
  27.       <ul>
  28.         <li>NAME=<var><a href="../values.html#cdata">CDATA</a></var> (key in submitted form)</li>
  29.         <li>MULTIPLE (allow multiple selections)</li>
  30.         <li>SIZE=<var><a href="../values.html#number">Number</a></var> (number of visible options)</li>
  31.         <li>DISABLED (disable element)</li>
  32.         <li>TABINDEX=<var><a href="../values.html#number">Number</a></var> (position in tabbing order)</li>
  33.         <li>ONFOCUS=<var><a href="../values.html#script">Script</a></var> (element received focus)</li>
  34.         <li>ONBLUR=<var><a href="../values.html#script">Script</a></var> (element lost focus)</li>
  35.         <li>ONCHANGE=<var><a href="../values.html#script">Script</a></var> (element value changed)</li>
  36.         <li><a href="../attrs.html">common attributes</a></li>
  37.       </ul>
  38.     </td>
  39.   </tr>
  40.   <tr valign=top>
  41.     <th>Contents</th>
  42.     <td>One or more <a href="optgroup.html">OPTGROUP</a> or <a href="option.html">OPTION</a> elements</td>
  43.   </tr>
  44.   <tr valign=top>
  45.     <th>Contained in</th>
  46.     <td><a href="../block.html">Block-level elements</a>, <a href="../inline.html">inline elements</a> except <a href="button.html">BUTTON</a></td>
  47.   </tr>
  48. </table>
  49. <p>The <strong class=html>SELECT</strong> element defines a form control for the <em>selection of options</em>. While <strong class=html>SELECT</strong> is most useful within a <strong class=html><a href="form.html">FORM</a></strong>, HTMLá4.0 allows <strong class=html>SELECT</strong> in any <a href="../block.html">block-level</a> or <a href="../inline.html">inline</a> element other than <strong class=html><a href="button.html">BUTTON</a></strong>. However, <a href="http://www.netscape.com/navigator/">Netscape Navigator</a> will not display any <strong class=html>SELECT</strong> elements outside of a <strong class=html>FORM</strong>.</p>
  50. <p>The <strong class=html>SELECT</strong> element contains one or more <strong class=html><a href="optgroup.html">OPTGROUP</a></strong> or <strong class=html><a href="option.html">OPTION</a></strong> elements to provide a menu of choices for the user. Each choice is contained within an <strong class=html>OPTION</strong> element. Choices can be grouped logically through the <strong class=html>OPTGROUP</strong> element. <strong class=html>SELECT</strong>'s <strong class=html>NAME</strong> attribute provides the key sent to the server with the value of the selected option.</p>
  51. <p>By default, the user can only select one option. The boolean <strong class=html>MULTIPLE</strong> attribute allows the user to select multiple options, which are submitted as separate name/value pairs. The following example uses the <strong class=html>MULTIPLE</strong> attribute to allow the selection of one or more options:</p>
  52. <p class=example><code class=html><P>Select one or more sections to search:<br><strong><SELECT NAME=sections MULTIPLE></strong><br><OPTION>Web Authoring Reference</OPTION><br><OPTION>FAQ Archives</OPTION><br><OPTION>Design Elements</OPTION><br><OPTION>Tools</OPTION><br><OPTION>Feature Article</OPTION><br><strong></SELECT></strong><br></P></code></p>
  53. <p>The boolean <strong class=html>DISABLED</strong> attribute, new in HTMLá4.0 and poorly supported by current browsers, makes the <strong class=html>SELECT</strong> element unavailable. The user is unable to edit the disabled selection, no value is submitted with the form, the <strong class=html>SELECT</strong> element cannot receive focus, and the element is skipped when navigating the document by tabbing.</p>
  54. <p>The <strong class=html>TABINDEX</strong> attribute specifies a number between 0 and 32767 to indicate the tabbing order of the element. A <strong class=html>SELECT</strong> element with <strong class=html>TABINDEX=0</strong> or no <strong class=html>TABINDEX</strong> attribute will be visited after any elements with a positive <strong class=html>TABINDEX</strong>. Among positive <strong class=html>TABINDEX</strong> values, the lower number receives focus first. In the case of a tie, the element appearing first in the <abbr class=initialism title="HyperText Markup Language">HTML</abbr> document takes precedence.</p>
  55. <p>The <strong class=html>SIZE</strong> attribute of <strong class=html>SELECT</strong> 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 <strong class=html>SIZE</strong> attribute is especially useful in <strong class=html>SELECT</strong> elements with numerous <strong class=html>OPTION</strong>s and multiple selections allowed. In such a situation, some visual browsers will render the entire list in one large box without scrolling; a suitable <strong class=html>SIZE</strong> attribute helps such browsers give a more appropriate presentation.</p>
  56. <p>The <strong class=html>SELECT</strong> element also takes a number of attributes to specify client-side scripting actions for various events. In addition to the <a href="../attrs.html#events">core events</a> common to most elements, <strong class=html>SELECT</strong> accepts the following event attributes:</p>
  57. <ul>
  58.   <li><strong class=html>ONFOCUS</strong>, when the element receives focus;</li>
  59.   <li><strong class=html>ONBLUR</strong>, when the element loses focus;</li>
  60.   <li><strong class=html>ONCHANGE</strong>, when the element loses focus and its value has changed since it received focus.</li>
  61. </ul>
  62. <h2>More Information</h2>
  63. <ul>
  64.   <li><a href="http://www.w3.org/TR/REC-html40/interact/forms.html#edef-SELECT">SELECT in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá4.0 Recommendation</a></li>
  65.   <li><a href="http://www.w3.org/TR/REC-html32#select">SELECT in <abbr class=initialism title="World Wide Web Consortium">W3C</abbr> HTMLá3.2 Recommendation</a></li>
  66.   <li><a href="http://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.1.3">SELECT in HTMLá2.0 Standard</a></li>
  67.   <li><a href="http://www.htmlhelp.com/reference/wilbur/form/select.html">SELECT in <abbr class=initialism title="Web Design Group">WDG</abbr> HTMLá3.2 Reference</a></li>
  68.   <li><a href="http://www.hut.fi/u/jkorpela/HTML3.2/5.47.html">SELECT in <cite>Learning HTMLá3.2 by Examples</cite></a></li>
  69. </ul>
  70. <div class=footer>
  71. <address>Maintained by <a href="http://www.htmlhelp.com/%7Eliam/">Liam Quinn</a> <<a href="mailto:liam@htmlhelp.com">liam@htmlhelp.com</a>></address>
  72. <p class=toolbar><a href="http://www.htmlhelp.com/"><img src="../wdglogo-small.gif" width=105 height=40 alt="Web Design Group ~"></a> <a href="../index.html" rel=Start>HTMLá4.0áReference</a>á~ <a href="../olist.html">ElementsábyáFunction</a>á~ <a href="../alist.html">ElementsáAlphabetically</a></p>
  73. <p class=copyright><a href="http://www.htmlhelp.com/copyright.html">Copyright ⌐</a> 1998 Liam Quinn. All rights reserved.</p>
  74. </div>
  75. </body>
  76. </html>
  77.