Main Page

input elements

A form can contain any number of input elements:
— The main HTML input element. The type attribute determines what type of input
control is displayed:
— A single-line text box
— A radio button
— A check box
— A file upload text box
“password” –
A password text box (where characters are not displayed as you type)
— A generic button that can be used to cause a custom action
— A button whose sole purpose is to submit the form
— A button whose sole purpose is to reset all fields in the form to their
default values
— An input field that isn’t displayed on screen
— An image that is used just like a Submit button
— Renders either a combo box or a list box composed of values defined by
— Renders a multiline text box in a size determined by the
Here is a simple form using the various input elements:
<title>Sample Form</title>
<form method=”post” action=”handlepost.jsp”>
<!-- regular textbox -->
<label for=”txtName”>Name:</label><br />
<input type=”text” id=”txtName” name=”txtName” /><br />
<!-- password textbox -->
<label for=”txtPassword”>Password:</label><br />
<input type=”password” id=”txtPassword” name=”txtPassword” /><br />
<!-- age comboxbox (drop-down) -->
<label for=”selAge”>Age:</label><br />
<select name=”selAge” id=”selAge”>
<option>Over 35</option>
</select><br />
Chapter 11
14_579088 ch11.qxd 3/28/05 11:40 AM Page 336

JavaScript EditorFree JavaScript Editor     Ajax Editor