1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<title>Forms [Robin’s HTML 4.0 Conformance Test]</title>
<meta name="description" content="Test your Web browser’s support for HTML 4.0 forms. Part of Robin’s HTML 4.0 Conformance Test.">
<meta name="DC.Creator" content="Lionheart, Robin">
<link rel="home" href="http://www.robinlionheart.com/" title="RobinLionheart.com">
<link rel="first" href="./" title="Robin’s HTML 4.0 Test">
<link rel="prev" href="edit" title="Edits">
<link rel="next" href="frames" title="Frames">
<link rel="glossary" href="glossary" title="Glossary">
<link rel="author" href="http://www.robinlionheart.com/robin/" title="Robin Lionheart">
<link rel="stylesheet" href="/style/linkcolors.css" type="text/css" media="screen, tv, projection">
<link rel="stylesheet" href="html4.css" type="text/css" media="screen, tv, projection" title="Conformance Test">
<link rel="icon" href="/images/icons/htmltest.png" type="image/png">
<div id="navbar">
<ul class="nl" id="breadcrumbs"><li><a href="./" rel="first">Robin’s HTML 4.0 Test</a><ul><li>Forms</li></ul></li></ul>
<ul class="nl">
<li><a href="./" rel="first" accesskey="1" title="First: Robin’s HTML 4.0 Test">⇤<strong>1</strong>st</a></li>
<li><a href="edit" rel="prev" accesskey="P" title="Prior: Edits">←<strong>P</strong>rior</a></li>
<li><a href="frames" rel="next" accesskey="N" title="Next: Frames"><strong>N</strong>ext→</a></li>
</ul>
</div>
<h1>Forms (<a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html" title="HTML 4.0 Specification">§17</a>)</h1>
<div class="section" id="fieldset">
<h2>Fieldsets and tab indexes</h2>
<div class="bodytext">
<ul>
<li><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-fieldset" title="HTML 4.0 Specification: 17 Forms"><code class="element"><fieldset></code></a></dfn> groups related form controls into sections.
<li><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-legend" title="HTML 4.0 Specification: 17 Forms"><code class="element"><legend></code></a></dfn> assigns a caption to a <code class="element"><fieldset></code>.
</ul>
<ul>
<li><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#adef-tabindex" title="HTML 4.0 Specification: 17 Forms"><code class="attribute">tabindex</code></a></dfn> lets you set the order in which hyperlinks and form controls gain focus.
</ul>
<p class="sugg"><strong class="subhead"><abbr>XHTML</abbr> 2.0:</strong> The <abbr>W3C</abbr> is discussing replacing <code class="attribute">tabindex</code> in <abbr>XHTML</abbr> 2.0 with common <a class="specsect" href="http://www.w3.org/TR/xhtml2/mod-hyperAttributes.html#col_Hypertext" title="XHTML 2.0 Working Draft: Hypertext Attributes Module"><code class="attribute">nextfocus</code> and <code class="attribute">prevfocus</code> attributes</a>, which contain an <code class="attribute">id</code> reference of the next element to be activated.</p>
</div>
<div class="illo">
<h3>Example:</h3>
<p>The controls are numbered according to their tab order. Tabbing forward from "1:" should take you to "2:", and so forth.</p>
<div class="blockcode">
<em class="html"><form action="#test"></em><br>
<div class="indent">
<em class="html4"><strong class="tested"><fieldset></strong></em><br>
<div class="indent">
<em class="html4"><strong class="tested"><legend></strong></em>Tab Index<em class="html4"><strong class="tested"></legend></strong></em><br>
<em class="html"><p></em>The focus should move through the following controls in numerical order.<em class="html"></p></em><br>
<em class="html"><table></em><br>
<div class="indent">
<em class="html"><tr></em><br>
<div class="indent">
<em class="html"><td></em>1: <em class="html"><td><input <em class="html4"><strong class="tested">tabindex=1</strong></em> value="One" size=6></em><br>
<em class="html"><td></em>3: <em class="html"><td><input <em class="html4"><strong class="tested">tabindex=3</strong></em> value="Three" size=6></em><br>
<em class="html"><td></em>7: <em class="html"><td><input <em class="html4"><strong class="tested">tabindex=7</strong></em> value="Seven" size=6></em><br>
</div>
<em class="html"><tr></em><br>
<div class="indent">
<em class="html"><td></em>2: <em class="html"><td><input <em class="html4"><strong class="tested">tabindex=2</strong></em> value="Two" size=6></em><br>
<em class="html"><td></em>4: <em class="html"><td><input <em class="html4"><strong class="tested">tabindex=4</strong></em> value="Four" size=6></em><br>
<em class="html"><td></em>6: <em class="html"><td><input <em class="html4"><strong class="tested">tabindex=6</strong></em> value="Six" size=6></em><br>
</div>
</div>
<em class="html"></table></em><br>
<em class="html"><table></em><br>
<div class="indent">
<em class="html"><tr></em><br>
<div class="indent">
<em class="html"><td></em>5:<br>
<em class="html"><td></em><br>
<div class="indent">
<em class="html"><select <em class="html4"><strong class="tested">tabindex=5</strong></em>></em><br>
<div class="indent">
<em class="html"><option selected></em>Five<br>
</div>
<em class="html"></select></em><br>
</div>
</div>
<em class="html"><tr></em><br>
<div class="indent">
<em class="html"><td></em>9:<br>
<em class="html"><td><textarea rows=2 cols=3 <em class="html4"><strong class="tested">tabindex=9</strong></em>></em>Nine<em class="html"></textarea></em><br>
</div>
</div>
<em class="html"></table></em><br>
8: <em class="html4"><button type="button" tabindex=8></em>Eight<em class="html4"></button></em><br>
</div>
<em class="html4"><strong class="tested"></fieldset></strong></em><br>
</div>
<em class="html"></form></em><br>
</div>
<h4 class="resultheader">Your Web browser renders it like this:</h4>
<div class="results" id="result1">
<form action="#test">
<fieldset>
<legend>Tab Index</legend>
<p>The focus should move through the following controls in numerical order.</p>
<table>
<tr>
<td>1: <td><input tabindex=1 value="One" size=6>
<td>3: <td><input tabindex=3 value="Three" size=6>
<td>7: <td><input tabindex=7 value="Seven" size=6>
<tr>
<td>2: <td><input tabindex=2 value="Two" size=6>
<td>4: <td><input tabindex=4 value="Four" size=6>
<td>6: <td><input tabindex=6 value="Six" size=6>
</table>
<table>
<tr>
<td>5:
<td>
<select tabindex=5>
<option selected>Five
</select>
<tr>
<td>9:
<td><textarea rows=2 cols=6 tabindex=9>Nine</textarea>
</table>
8: <button type="button" tabindex=8>Eight</button>
</fieldset>
</form>
</div>
</div>
</div>
<div class="section" id="label">
<h2>Labels and access keys</h2>
<div class="bodytext">
<p><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-label" title="HTML 4.0 Specification: 17 Forms"><code class="element"><label></code></a></dfn> associates its contents with a form control. In a Web browser, selecting a label could give its corresponding control focus.</p>
<p>The <dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#adef-accesskey" title="HTML 4.0 Specification: 17 Forms"><code class="attribute">accesskey</code></a></dfn> attribute assigns a key to give focus to an element.</p>
<p class="sugg"><strong class="subhead"><abbr>XHTML</abbr> 2.0:</strong> The <abbr>W3C</abbr> is discussing replacing <code class="attribute">accesskey</code> in <abbr>XHTML</abbr> 2.0 with a common <a class="specsect" href="http://www.w3.org/TR/xhtml2/mod-hyperAttributes.html#col_Hypertext" title="XHTML 2.0 Working Draft: Hypertext Attributes Module"><code class="attribute">access</code> attribute</a> to assign an <q>access name</q> that will activate an element. <code class="attribute">accesskey</code> is too associated with particular user interfaces. Instead of keystrokes, <code class="attribute">access</code> associate words with elements which users may select them by other means, such as selecting them from a menu or speaking an access name into a microphone.</p>
</div>
<div class="illo">
<h3>Example:</h3>
<p>Selecting (ex. clicking on) the following labels should activate the corresponding field. The highlighted letters are designated as shortcut keys for the field, which may be supported in different ways by different Web browsers.</p>
<p>For example, in <em class="browser">Internet Explorer 4.0—</em> and <em class="browser">Netscape 6.0—</em> for Windows, <kbd>Alt‐U</kbd> will select the “User name:” field.</p>
<div class="blockcode">
<em class="html"><form action="#test"></em><br>
<div class="indent">
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html"><em class="html4"><legend <strong class="tested">accesskey="L"</strong>></em><strong></em>L<em class="html"></strong></em>abels and Access Keys<em class="html4"></legend></em><br>
<em class="html"><p></em>Selecting the following labels should activate the corresponding form control. You may also be able to use the highlighted letters to select a form control.<em class="html"></p></em><br>
<br>
<em class="html"><strong class="tested"><label accesskey="U"></strong><strong></em>U<em class="html"></strong></em>ser name: <em class="html"><input type="text" name="uname" size=40><strong class="tested"></label></strong><br></em><br>
<em class="html"><strong class="tested"><label for="email"></strong><strong></em>E<em class="html"></strong></em><em class="html4"><em class="entity">&#8208;</em></em>mail: <em class="html"><input <em class="html4"><strong class="tested">id="email" accesskey="E"</strong></em> type="text" name="email" size=40><strong class="tested"></label></strong><br></em><br>
<br>
<em class="html"><p></em>Sex:<br>
<em class="html"><em class="html4"><strong class="tested"><label accesskey="M"></strong></em><input type="radio" name="sex" value="male"><strong></em>M<em class="html"></strong></em>ale<em class="html"><strong class="tested"></label></strong><br></em><br>
<br>
<em class="html"><input <em class="html4"><strong class="tested">id="female" accesskey="F"</strong></em> type="radio" name="sex" value="female"><strong class="tested"><label for="female"></strong><strong></em>F<em class="html"></strong></em>emale<em class="html4"><strong class="tested"></label></strong></em><em class="html"></p></em><br>
<br>
<em class="html"><p></em><em class="html4"><strong class="tested"><label accesskey="G"></strong></em><em class="html"><strong></em>G<em class="html"></strong></em>ender:<br>
<em class="html"><select size=2></em><br>
<div class="indent">
<em class="html"><option></em>Male<br>
<em class="html"><option></em>Female<br>
</div>
<em class="html"></select><strong class="tested"></label></strong></p></em><br>
<br>
<em class="html"><p><strong class="tested"><label for="honorific" accesskey="H"></strong><strong></em>H<em class="html"></strong></em>onorific:<em class="html4"><strong class="tested"></label></strong></em><br>
<em class="html"><select <em class="html4"><strong class="tested">id="honorific"</strong></em> size=3></em><br>
<div class="indent">
<em class="html"><option></em>Mr.<br>
<em class="html"><option></em>Ms.<br>
<em class="html"><option></em>Miss<br>
<em class="html"><option></em>Mrs.<br>
<em class="html"><option></em>Dr.<br>
</div>
<em class="html"></select></p></em><br>
<br>
<em class="html"><p></em>Where did you hear about us? (check all that apply)<em class="html"><br></em><br>
<em class="html"><strong class="tested"><label accesskey="S"></strong><input type="checkbox" name="where" value="search"><strong></em>S<em class="html"></strong></em>earch engine<em class="html4"><strong class="tested"></label></strong></em><br>
<br>
<em class="html"><strong class="tested"><label></strong><input type="checkbox" <strong class="tested">accesskey="O"</strong> name="where" value="other"><strong></em>O<em class="html"></strong></em>ther<em class="html4"><strong class="tested"></label></strong></em><em class="html"></p></em><br>
<br>
<em class="html"><p></em><em class="html4"><strong class="tested"><label accesskey="W"></strong></em>If other, <em class="html"><strong></em>w<em class="html"></strong></em>here?<em class="html"><br></em><br>
<em class="html"><textarea rows=2 cols=40></textarea><strong class="tested"></label></strong></p></em><br>
<br>
<em class="html"><p></em><em class="html4"><strong class="tested"><label></strong></em><em class="html"><strong></em>C<em class="html"></strong></em>omments:<em class="html"><br></em><br>
<em class="html"><textarea rows=2 cols=40 <strong class="tested">accesskey="C"</strong>></textarea><strong class="tested"></label></strong></p></em><br>
</div>
<em class="html4"></fieldset></em><br>
</div>
<em class="html"></form></em><br>
</div>
<h4 class="resultheader">Your Web browser renders it like this:</h4>
<div class="results" id="result2">
<form action="#test">
<fieldset>
<legend accesskey="L"><strong>L</strong>abels and Access Keys</legend>
<p>Selecting the following labels should activate the corresponding form control. You may also be able to use the highlighted letters to select a form control.</p>
<label accesskey="U"><strong>U</strong>ser name: <input type="text" name="uname" size=40></label><br>
<label><strong>E</strong>‐mail: <input id="email" accesskey="E" type="text" name="email" size=40></label><br>
<p>Sex:
<label accesskey="M"><input type="radio" name="sex" value="male"><strong>M</strong>ale</label>
<input id="female" type="radio" name="sex" value="female" accesskey="F"><label for="female"><strong>F</strong>emale</label></p>
<p><label accesskey="G"><strong>G</strong>ender:
<select size=2>
<option>Male
<option>Female
</select></label></p>
<p><label for="honorific" accesskey="H"><strong>H</strong>onorific:</label>
<select id="honorific" size=5>
<option>Mr.
<option>Ms.
<option>Miss
<option>Mrs.
<option>Dr.
</select></p>
<p>Where did you hear about us? (check all that apply)<br>
<label accesskey="S"><input type="checkbox" name="where" value="search"><strong>S</strong>earch engine</label>
<label><input type="checkbox" accesskey="O" name="where" value="other"><strong>O</strong>ther</label></p>
<p><label accesskey="W">If other, <strong>w</strong>here?<br>
<textarea rows=2 cols=40></textarea></label></p>
<p><label><strong>C</strong>omments:<br>
<textarea rows=2 cols=40 accesskey="C"></textarea></label></p>
</fieldset>
</form>
</div>
<p class="note bugzilla">Related <em class="browser">Mozilla</em> bug reports: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=Accesskey-XUL">Accesskey-XUL</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=Legend-Accesskey">Legend-Accesskey</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=Fieldset-Eats-Spaces">Fieldset-Eats-Spaces</a>, <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=Checkbox-Accesskey">Checkbox-Accesskey</a>.</p>
<p class="note msie">Related <em class="browser">Internet Explorer</em> bug reports: <a href="http://channel9.msdn.com/wiki/default.aspx/Channel9.InternetExplorerStandardsSupport">Channel9 Wiki: Internet Explorer Standards Support</a>.</p>
</div>
</div>
<div class="section" id="button">
<h2>Buttons</h2>
<div class="bodytext">
<p><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-button" title="HTML 4.0 Specification: 17 Forms"><code class="element"><button></code></a></dfn> allows push button controls to contain any sort of markup, not just simple text.</p>
</div>
<div class="illo">
<h3>Example:</h3>
<p>This form has buttons of each type. The change message buttons change the message field when selected, if your Web browser supports ECMAScript. If you type over the text in the message field, Reset should restore the message to its default. Submitting the form should reload this page.</p>
<div class="blockcode">
<em class="html"><form action="#test"></em><br>
<div class="indent">
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html4"><legend></em>Buttons<em class="html4"></legend></em><br>
<em class="html"><p></em>Message: <em class="html"><input <em class="html4">id="message"</em> type="text" name="message" size="40" value="Change this then try Reset."></p></em><br>
<em class="html"><p></em>Change message:<br>
<em class="html4"><strong class="tested"><button type="button" <em class="html4">onclick="document .getElementById('message') .setAttribute('value', 'Take it easy!')"</em>></strong></em>Get Some R<em class="html"><em class="entity">&amp;</em></em>R<em class="html4"><strong class="tested"></button></strong></em><br>
<em class="html4"><strong class="tested"><button type="button" <em class="html4">onclick="document .getElementById('message') .setAttribute('value', 'Have a nice day!')"</em>></strong></em>Smile <em class="html"><img src="/images/smiley/smile.png" alt=":-)"><strong class="tested"></button></strong></em><br>
<em class="html4"><strong class="tested"><button type="button" <em class="html4">onclick="document .getElementById('message') .setAttribute('value', 'Lather, rinse, repeat')"</em>></strong></em><br>
<div class="indent">
<em class="html"><ul></em><br>
<div class="indent">
<em class="html"><li></em>Lather<br>
<em class="html"><li></em>Rinse<br>
<em class="html"><li></em>Repeat<br>
</div>
<em class="html"></ul></em><br>
</div>
<em class="html"><strong class="tested"></button></strong></p></em><br>
<em class="html"><p><strong class="tested"><button type="submit"></strong></em>Submit<em class="html4"><strong class="tested"></button></strong></em><br>
<em class="html4"><strong class="tested"><button type="reset"></strong></em>Reset<em class="html4"><strong class="tested"></button></strong></em><em class="html"></p></em><br>
</div>
<em class="html4"></fieldset></em><br>
</div>
<em class="html"></form></em><br>
</div>
<h4 class="resultheader">Your Web browser renders it like this:</h4>
<div class="results" id="result3">
<form action="#test">
<fieldset>
<legend>Buttons</legend>
<p>Message: <input id="message" type="text" name="message" size="40" value="Change this then try Reset."></p>
<p>Change message:
<button type="button" onclick="document .getElementById('message') .setAttribute('value', 'Take it easy!')">Get Some R&R</button>
<button type="button" onclick="document .getElementById('message') .setAttribute('value', 'Have a nice day!')">Smile <img src="/images/smiley/smile.png" alt=":-)"></button>
<button type="button" onclick="document .getElementById('message') .setAttribute('value', 'Lather, rinse, repeat')">
<ul>
<li>Lather
<li>Rinse
<li>Repeat
</ul>
</button></p>
<p><button type="submit">Submit</button>
<button type="reset">Reset</button></p>
</fieldset>
</form>
</div>
</div>
</div>
<div class="section" id="optgroup">
<h2>Option groups</h2>
<div class="bodytext">
<p><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-optgroup" title="HTML 4.0 Specification: 17 Forms"><code class="element"><optgroup></code></a></dfn> groups into sections the <a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-option" title="HTML 4.0 Specification: 17 Forms"><code class="element"><option></code></a> elements in a <a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#edef-select" title="HTML 4.0 Specification: 17 Forms"><code class="element"><select></code></a> control. A Web browser could add dividers or headings to the drop‐down list, or collapse them into cascading drop‐down menus.</p>
<p>The <dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#adef-label" title="HTML 4.0 Specification: 17 Forms"><code class="attribute">label</code></a></dfn> attribute on the <code class="element"><optgroup></code> and <code class="element"><option></code> elements provides a name to use within grouped selection menus.</p>
</div>
<div class="illo">
<h3>Example:</h3>
<div class="blockcode">
<em class="html"><form action="#test"></em><br>
<div class="indent">
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html4"><legend></em>Option Groups<em class="html4"></legend></em><br>
<em class="html"><p></em>Browser of Choice:<br>
<em class="html"><select name="agent"></em><br>
<div class="indent">
<em class="html4"><strong class="tested"><optgroup label="Microsoft Internet Explorer"></strong></em><br>
<div class="indent">
<em class="html"><option <em class="html4"><strong class="tested">label="5.x<em class="entity">–</em>6.x"</strong></em> value="ie5"></em>Microsoft Internet Explorer 5.x<em class="html4"><em class="entity">&ndash;</em></em>6.x<br>
<em class="html"><option <em class="html4"><strong class="tested">label="4.x"</strong></em> value="ie4"></em>Microsoft Internet Explorer 4.x<br>
<em class="html"><option <em class="html4"><strong class="tested">label="3.0 or lower"</strong></em> value="ie3"></em>Microsoft Internet Explorer 3.0 or lower<br>
</div>
<em class="html4"><strong class="tested"></optgroup></strong></em><br>
<em class="html4"><strong class="tested"><optgroup label="Mozilla"></strong></em><br>
<div class="indent">
<em class="html"><option <strong class="tested">label="Firefox"</strong> value="fox"></em>Mozilla Firefox<br>
<em class="html"><option value="moz" selected></em>Mozilla<br>
</div>
<em class="html4"><strong class="tested"></optgroup></strong></em><br>
<em class="html4"><strong class="tested"><optgroup label="Netscape"></strong></em><br>
<div class="indent">
<em class="html"><option <em class="html4"><strong class="tested">label="6.x"</strong></em> value="n6"></em>Netscape 6.x<br>
<em class="html"><option <em class="html4"><strong class="tested">label="4.x"</strong></em> value="n4"></em>Netscape 4.x<br>
<em class="html"><option <em class="html4"><strong class="tested">label="3.x or lower"</strong></em> value="n3"></em>Netscape 3.x or lower<br>
</div>
<em class="html4"><strong class="tested"></optgroup></strong></em><br>
<em class="html"><option value="op"></em>Opera<br>
<em class="html"><option value="safari"></em>Safari<br>
<em class="html"><option value="omniweb"></em>OmniWeb<br>
<em class="html"><option value="icab"></em>iCab<br>
<em class="html"><option value="lynx"></em>Lynx<br>
<em class="html"><option value="other"></em>Other<br>
</div>
<em class="html"></select></p></em><br>
</div>
<em class="html4"></fieldset></em><br>
</div>
<em class="html"></form></em><br>
</div>
<h4 class="resultheader">Your Web browser renders it like this:</h4>
<div class="results" id="result4">
<form action="#test">
<fieldset>
<legend>Option Groups</legend>
<p>Browser of Choice:
<select name="agent">
<optgroup label="Microsoft Internet Explorer">
<option label="5.x–6.x" value="ie5">Microsoft Internet Explorer 5.x–6.x
<option label="4.x" value="ie4">Microsoft Internet Explorer 4.x
<option label="3.x or lower" value="ie3">Microsoft Internet Explorer 3.x or lower
</optgroup>
<optgroup label="Mozilla">
<option label="Firefox" value="fox">Mozilla Firefox
<option value="moz" selected>Mozilla
</optgroup>
<optgroup label="Netscape">
<option label="6.x" value="n6">Netscape 6.x
<option label="4.x" value="n4">Netscape 4.x
<option label="3.x or lower" value="n3">Netscape 3.x or lower
</optgroup>
<option value="op">Opera
<option value="safari">Safari
<option value="omniweb">OmniWeb
<option value="icab">iCab
<option value="lynx">Lynx
<option value="other">Other
</select></p>
</fieldset>
</form>
</div>
<p class="note bugzilla">Related <em class="browser">Mozilla</em> bug reports: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=Option-Label">Option-Label</a>.</p>
<p class="note msie">Related <em class="browser">Internet Explorer</em> bug reports: <a href="http://channel9.msdn.com/wiki/default.aspx/Channel9.InternetExplorerStandardsSupport">Channel9 Wiki: Internet Explorer Standards Support</a>.</p>
</div>
<div class="illo">
<h3>Example:</h3>
<p>The previous example again, but with <code>size="10"</code> set on the <code class="element"><select></code> element.</p>
<h4 class="resultheader">Your Web browser renders it like this:</h4>
<div class="results" id="result5">
<form action="#test">
<fieldset>
<legend>Option Groups</legend>
<p>Browser of Choice:
<select name="agent" size="10">
<optgroup label="Microsoft Internet Explorer">
<option label="5.x–6.x" value="ie5">Microsoft Internet Explorer 5.x–6.x
<option label="4.x" value="ie4">Microsoft Internet Explorer 4.x
<option label="3.x or lower" value="ie3">Microsoft Internet Explorer 3.x or lower
</optgroup>
<optgroup label="Mozilla">
<option label="Firefox" value="fox">Mozilla Firefox
<option value="moz" selected>Mozilla
</optgroup>
<optgroup label="Netscape">
<option label="6.x" value="n6">Netscape 6.x
<option label="4.x" value="n4">Netscape 4.x
<option label="3.x or lower" value="n3">Netscape 3.x or lower
</optgroup>
<option value="op">Opera
<option value="safari">Safari
<option value="omniweb">OmniWeb
<option value="icab">iCab
<option value="lynx">Lynx
<option value="other">Other
</select></p>
</fieldset>
</form>
</div>
<p class="note bugzilla">Related <em class="browser">Mozilla</em> bug reports: <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=Option-Label">Option-Label</a>.</p>
<p class="note msie">Related <em class="browser">Internet Explorer</em> bug reports: <a href="http://channel9.msdn.com/wiki/default.aspx/Channel9.InternetExplorerStandardsSupport">Channel9 Wiki: Internet Explorer Standards Support</a>.</p>
</div>
</div>
<div class="section" id="readonly">
<h2>Disabled and Read‐only</h2>
<div class="bodytext">
<ul>
<li><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#adef-disabled" title="HTML 4.0 Specification: 17 Forms"><code class="attribute">disabled</code></a></dfn> prevents a form control from receiving focus or accepting input. Disabled controls do not send data when the form is submitted.
<li><dfn><a class="specsect" href="http://www.w3.org/TR/html4/interact/forms.html#adef-readonly" title="HTML 4.0 Specification: 17 Forms"><code class="attribute">readonly</code></a></dfn> prohibits changes to a form control. Read‐only controls still send data when the form is submitted.
</ul>
</div>
<div class="note">
<p>Though <abbr>HTML</abbr> 4.0’s definition of <code class="attribute">readonly</code> implies that checkboxes and radio buttons may be set read‐only (and no errata has changed the definition), <code class="attribute">readonly</code> is meant only for <code class="value">text</code> or <code class="value">password</code>.</p>
<p>In a <a href="http://whatwg.org/specs/web-forms/current-work/#readonly">working draft of the Web Forms 2.0 standard</a>, <abbr>WHAT</abbr> Working Group clarifies, <q cite="http://whatwg.org/specs/web-forms/current-work/#readonly">Specifically, it does not apply to radio buttons, check boxes, file upload fields, select elements, or any of the button types; the interface concept of <q>readonly</q> values does not apply to button‐like interfaces.</q> Also, the <a href="glossary#dom" rel="glossary">Document Object Model</a> level 2 standard describes the associated <code>readOnly</code> method as <q cite="http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-88461592">Relevant only when <code class="attribute">type</code> has the value “<code class="value">text</code>” or “<code class="value">password</code>”.</q></p>
<p>(<em class="browser">Opera 5.x</em> supported read‐only checkboxes and radio buttons, but removed support for them in version <em class="version">6.0</em>.)</p>
</div>
<div class="illo">
<h3>Example:</h3>
<div class="blockcode">
<em class="html"><form action="#test"></em><br>
<div class="indent">
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html4"><legend></em>Disabled and Read<em class="html"><em class="entity">&#8208;</em></em>Only<em class="html4"></legend></em><br><br>
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html4"><legend></em>Normal<em class="html4"></legend></em><br>
<em class="html"><p></em>These controls should be fully functional.<em class="html"></p></em><br>
<em class="html"><input type="text" value="Changeable" size=14></em><br>
<em class="html"><input type="checkbox" checked></em><br>
<em class="html"><input type="radio" name="yn1"></em>Yes <em class="html"><input type="radio" name="yn1" checked></em>No<br>
<em class="html"><br></em><br>
<em class="html"><textarea rows=3 cols=20></em>Can edit this.<em class="html"></textarea></em><br>
<em class="html"><select size=3></em><br>
<div class="indent">
<em class="html"><option></em>One<br>
<em class="html"><option selected></em>Two<br>
<em class="html"><option></em>Three<br>
</div>
<em class="html"></select></em><br>
</div>
<em class="html4"></fieldset></em><br><br>
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html4"><legend></em>Disabled<em class="html4"></legend></em><br>
<em class="html"><p></em>You should not be able to select these controls.<em class="html"></p></em><br>
<em class="html"><input type="text" value="Unselectable" size=14 <em class="html4"><strong class="tested">disabled</strong></em>></em><br>
<em class="html"><input type="checkbox" checked <em class="html4"><strong class="tested">disabled</strong></em>></em><br>
<em class="html"><input type="radio" name="yn3" <em class="html4"><strong class="tested">disabled</strong></em>></em>Yes <em class="html"><input type="radio" name="yn3" checked <em class="html4"><strong class="tested">disabled</strong></em>></em>No<br>
<em class="html"><br></em><br>
<em class="html"><textarea rows=3 cols=20 <em class="html4"><strong class="tested">disabled</strong></em>></em>Can't touch this.<em class="html"></textarea></em><br>
<em class="html"><select size=3 <em class="html4"><strong class="tested">disabled</strong></em>></em><br>
<div class="indent">
<em class="html"><option></em>One<br>
<em class="html"><option selected></em>Two<br>
<em class="html"><option></em>Three<br>
</div>
<em class="html"></select></em><br>
<em class="html"><input type="reset" <em class="html4"><strong class="tested">disabled</strong></em>></em><br>
<em class="html4"><button type="reset" <em class="html4"><strong class="tested">disabled</strong></em>></em>Undo changes<em class="html4"></button></em><br>
<em class="html"><br></em><br>
<em class="html"><p></em>You should be able to select only option A or B.<em class="html"></p></em><br>
<em class="html"><select size=7></em><br>
<div class="indent">
<em class="html4"><optgroup label="Pass"></em><br>
<div class="indent">
<em class="html"><option></em>A<br>
<em class="html"><option></em>B<br>
<em class="html"><option <em class="html4"><strong class="tested">disabled</strong></em>></em>C (unavailable)<br>
</div>
<em class="html4"></optgroup></em><br>
<em class="html4"><optgroup label="Fail (unavailable)" <em class="html4"><strong class="tested">disabled</strong></em>></em><br>
<div class="indent">
<em class="html"><option></em>D<br>
<em class="html"><option></em>F<br>
</div>
<em class="html4"></optgroup></em><br>
</div>
<em class="html"></select></em><br>
</div>
<em class="html4"></fieldset></em><br><br>
<em class="html4"><fieldset></em><br>
<div class="indent">
<em class="html4"><legend></em>Read<em class="html"><em class="entity">&#8208;</em></em>Only<em class="html4"></legend></em><br>
<em class="html"><p></em>You should be able to select but not change these controls.<em class="html"></p></em><br>
<em class="html"><input type="text" value="Unchangeable" size=14 <em class="html4"><strong class="tested">readonly</strong></em>></em><br>
<em class="html"><br></em><br>
<em class="html"><textarea rows=3 cols=20 <em class="html4"><strong class="tested">readonly</strong></em>></em>Can't edit this.<em class="html"></textarea></em><br>
</div>
<em class="html4"></fieldset></em><br>
</div>
<em class="html4"></fieldset></em><br>
</div>
<em class="html"></form></em><br>
</div>
<h4 class="resultheader">Your Web browser renders it like this:</h4>
<div class="results" id="result6">
<form action="#test">
<fieldset>
<legend>Disabled and Read‐Only</legend>
<fieldset>
<legend>Normal</legend>
<p>These controls should be fully functional.</p>
<input type="text" value="Changeable" size=14>
<input type="checkbox" checked>
<input type="radio" name="yn1">Yes <input type="radio" name="yn1" checked>No
<br>
<textarea rows=3 cols=20>Can edit this.</textarea>
<select size=3>
<option>One
<option selected>Two
<option>Three
</select>
</fieldset>
<fieldset>
<legend>Disabled</legend>
<p>You should not be able to select these controls.</p>
<input type="text" value="Unselectable" size=14 disabled>
<input type="checkbox" checked disabled>
<input type="radio" name="yn3" disabled>Yes <input type="radio" name="yn3" checked disabled>No
<br>
<textarea rows=3 cols=20 disabled>Can't touch this.</textarea>
<select size=3 disabled>
<option>One
<option selected>Two
<option>Three
</select>
<input type="reset" disabled>
<button type="reset" disabled>Undo changes</button>
<p>You should be able to select only option A or B.</p>
<select size=7>
<optgroup label="Pass">
<option>A
<option>B
<option disabled>C (unavailable)
</optgroup>
<optgroup label="Fail (unavailable)" disabled>
<option>D
<option>F
</optgroup>
</select>
</fieldset>
<fieldset>
<legend>Read‐Only</legend>
<p>You should be able to select but not change these controls.</p>
<input type="text" value="Unchangeable" size=14 readonly>
<br>
<textarea rows=3 cols=20 readonly>Can't edit this.</textarea>
</fieldset>
</fieldset>
</form>
</div>
</div>
</div>
<div id="browserver">
<h2>Your Browser</h2>
<p>Your Web browser identified itself as <strong><code id="useragent">Wget/1.11.4</code></strong> when it requested this page.</p>
<script type="text/javascript" src="browserid.js"></script>
<noscript><p>Your Web browser did not run a script to reveal how it identifies itself to scripts.</p></noscript>
</div>
<div id="footer">
<div id="buttons">
<a href="http://www.mozilla.com/firefox/" title="Mozilla Firefox"><object type="image/png" width="80" height="15" id="firefox_button" data="/images/buttons/firefox.png">Get Firefox</object></a>
<a href="http://my.opera.com/rlionheart/affiliate/" title="Opera"><object type="image/png" width="80" height="15" id="opera_button" data="/images/buttons/opera.png">Get Opera</object></a>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/" title="Creative Commons Deed"><object type="image/png" width="80" height="15" id="cc_button" data="/images/buttons/cc.png">Some rights reserved.</object></a>
<a href="http://www.htmlhelp.com/cgi-bin/validate.cgi?url=referer" title="WDG HTML Validation Service"><object type="image/png" width="80" height="15" id="html401_button" data="/images/buttons/html401.png">Valid HTML 4.01</object></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" title="W3C CSS Validation Service"><object type="image/png" width="80" height="15" id="css_button" data="/images/buttons/css.png">Valid CSS</object></a>
</div>
<p><a rel="copyright" href="/copyright" class="local">©</a> 1998 <span class="vcard"><a rel="home" href="/" class="local fn">Robin Lionheart</a> (<a rev="made" href="mailto:lionheart@robinlionheart.com" class="email local">lionheart@robin­lionheart.com</a>) [<a href="/robin/pubkey" class="local">public key</a>]</span></p>
<div id="dehanced">
<p>Best read with a browser that supports <abbr title="Extensible Hypertext Markup Language">XHTML</abbr>, <abbr title="Cascading Style Sheets level 2">CSS 2</abbr>, and <abbr title="Portable Network Graphics">PNG</abbr> images. I recommend <a href="http://www.mozilla.org/products/firefox/">Firefox</a>.</p>
<p>Degraded to fit your browser (JavaScript MIME type).</p>
</div> </div>
|