(^364) Chapter 9 XHTML Forms
Figure 9.14
This button has no
default action; it is
often used with
client-side scripting
such as JavaScript
This control is usually used with client-side scripting such as JavaScript, to cause some
processing to occur on the client (see Chapters 11 and 14). Types of client-side process-
ing may include calculations, edits, or other functions such as displaying a different
page. A sample button is shown in Figure 9.14.
The XHTML code follows:
<input type="button" value="Show Details" name="myButton"
id="myButton" />
Common button attributes are listed in Table 9.10.
Hidden.This form control is configured by the tag and is not displayed on
the Web page. Hidden form fields can be accessed by both client-side and server-side
scripting and sometimes contain information needed as the visitor moves from page to
page.
The XHTML to create a hidden form control with the name sendtoand the value of
an e-mail address follows:
<input type="hidden" name="sendto" id="sendto"
value="[email protected]"/>
Common hidden attributes are listed in Table 9.11.
Table 9.10Common button attributes
Common
Attributes Values Usage
type button Configures the button.
name Alphanumeric, no spaces, begins with a
letter
Names the form element so that it can be
easily accessed by client-side scripting lan-
guages (such as JavaScript) or by server-
side processing. The name should be
unique.
id Alphanumeric, no spaces, begins with a
letter
Provides a unique identifier for the form
element.
value Text or numeric characters Configures the text displayed on the button.
steven felgate
(Steven Felgate)
#1