HTML and CSS Reference
In-Depth Information
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.
Figure 9.14
This button has no
default action; it is
often used with
client-side scripting
such as JavaScript
The XHTML code follows:
<input type="button" value="Show Details" name="myButton"
id="myButton" />
Common button attributes are listed in Table 9.10.
Table 9.10 Common button attributes
Common
Attributes
Values
Usage
Configures the button.
type
button
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.
name
Alphanumeric, no spaces, begins with a
letter
Provides a unique identifier for the form
element.
id
Text or numeric characters
Configures the text displayed on the button.
value
Hidden. This form control is configured by the <input /> 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 sendto and the value of
an e-mail address follows:
<input type="hidden" name="sendto" id="sendto"
value="order@site.com"/>
Common hidden attributes are listed in Table 9.11.
 
Search WWH ::




Custom Search