|
To access the contents, click the chapter and section titles.
HTML 4.0 Sourcebook
The BUTTON element delimits text or other content to be displayed as a push button. There are three possible types: TYPE=button (the default), TYPE=submit, and TYPE=reset, which are functionally equivalent to INPUT elements of the same type. The difference is in the allowed content of the displayed buttonwith INPUT elements, this content is given by the VALUE attribute, while with BUTTON, this content is defined by the content of the button element, which can be any form of HTML markup. As a result, the rendered buttons can be far more complex. An example is shown in Figures 7.15 and 7.16, where the button contains paragraphs, blockquoted and enlarged-sized text, and images. BUTTON does take a VALUE attribute, which defines the value to associate with the buttonand send to the server or JavaScript programwhen the button is pressed.
There are some important restrictions to BUTTON content: BUTTON cannot contain the elements A, BUTTON, FIELDSET, FORM, IFRAME, INPUT, ISINDEX, LABEL, SELECT, or TEXTAREA. BUTTON elements can contain images, but these cannot be active or client-side imagemapped images. If you want a button image that is imagemapped, use the INPUT TYPE=image element. BUTTON is not supported by Netscape Navigator 4 and is not compatible with older browsers that do not support BUTTON. KEYGEN Element: Generate Encryption Key (Netscape Navigator Only)
KEYGEN generates encrypted public key certificates for submission, via a FORM, to a remote sitethe remote site can use this key to authenticate the data sent to the server and the identity of the sender. The mandatory NAME attribute defines the name to use when sending the data to the server. The optional CHALLENGE attribute is assigned a challenge string, which is encrypted along with the users public key when the value for the KEYGEN is calculated; the decrypted CHALLENGE value can determine the identity of the document that sent the request. The default value for CHALLENGE is an empty string. When present, KEYGEN produces a user-selectable list of key sizes. When the form is submitted, a key pair of the selected size is generated: The public key and challenge string are encoded, digitally signed with the private key, and encoded (base64) to produce the value part of the name/value pair. The private key is encrypted and is stored locally in a database of valid keys.
LABEL Element: Labeling Input Elements
The LABEL element defines a label for a specified input element. This relationship is defined using the FOR attribute of the LABEL, which takes, as its value, the ID value of the input mechanism with which the label is associated. For example, the markup <TD> <LABEL FOR=id23> Set As Default: </LABEL> </TD> <TD> <INPUT TYPE=checkbox ID=id23 NAME=fname VALUE=yes> </TD> associates the given label with the associated text input boxthe ID value linking the two is highlighted in boldface. Note that this does not affect the rendering of the text or input mechanism and merely provides a way of logically linking these two components. Furthermore, the ACCESSKEY attribute of a LABEL lets an author tie a keyboard character to the input element, as discussed later in the section describing the ACCESSKEY attribute. For example, the markup: <TD> <LABEL ACCESSKEY=d FOR=id23> Set As Default: </LABEL> </TD> <TD> <INPUT TYPE=checkbox ID=id23 NAME=fname VALUE=yes> </TD> means that the author can type a special acceleration key sequence (ALT-d under Microsoft Windows) to access and check the associated checkbox. For more details, please see the ACCESSKEY Attribute section, later in this chapter. Formally, a label can also be bound to an input element by placing the input element inside the LABEL, for example: <LABEL> First Name: <INPUT TYPE=checkbox NAME=fname VALUE=yes> </LABEL> However, this limits the way in which the label and associated input mechanism can be formatted (note that tabular layout of the two items is not possible). Given this limitation, plus the fact that this notation is not supported by Internet Explorer 4, you should avoid this approach. FIELDSET Element: Grouping Input Elements
FIELDSET groups together a related set of input elements and labels, so that they can be formatted and treated as a group. The content of a FIELDSET is simply a collection of input elements and labels, plus other HTML markup that structures the elements. Also allowed is a LEGEND element, which provides a label or title for the FIELDSETthis is the FIELDSET equivalent of a LABEL. For compatibility with older browsers, the LEGEND should appear just after the FIELDSET start tag.
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement. |