Prev | Current Page 400 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

For multiple-option controls (check
boxes and radio buttons), this attribute is identical, and an individual value attribute is set
in each start tag.
By default, controls of this type??”along with the select list??”are set to off (i.e., no values
selected), but you can define a default option. I??™ve done this for the select list by setting
selected="selected" on the Windows option. You??™d do the same on a radio button
to select it by default, and with a check box you??™d set checked="checked".
Some of the attributes define the appearance of controls: the input element??™s size attribute
sets a character width for the fields, while the textarea??™s rows and cols attributes set
the number of rows and columns, again in terms of characters. It??™s also worth noting that
any content within the textarea element is displayed, so if you want it to start totally
blank, you must ensure that there??™s nothing??”not even whitespace??”between the start and
end tags. (Some applications that reformat your code, and some website editors, place
whitespace here, which some browsers subsequently use as the default value/content of
the textarea. This results in the textarea??™s content being partially filled with spaces, and
anyone trying to use it may then find their cursor??™s initial entry point partway down the
text area, which can be off-putting.)
GETTING USER FEEDBACK
317
8
Long-time web users may have noticed the omission of a Reset button in this example.


Pages:
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