HTML and CSS Reference
In-Depth Information
Table 11.4 HTML Form Controls (continued)
Input Type
Attribute
Description
submit
name, id, value
When clicked, executes the form; launches cgi .
image
src, name, id, value, align
Same as submit button, but displays an image instead of
text. The image is in a file found at src .
reset
name, id value
Resets the form to its original position; clears all input
fields.
First let's see how input gets into the form by looking at a simple document (see
Figure 11.7) and the HTML code used to produce it (see Example 11.3). The user will
be able to click a button or enter data in the textbox. The input in this example won't be
processed when the Submit button is clicked. Nothing will be displayed by the browser.
Server
PHP
ASP
Browser/Fillout Form
http://webserver/from.html
name
address
credit card
San Francisco
London
New York
Tokyo
Perl
Form data
processed
here
HTTP
CGI
Form data
processed
here
Submit
Figure 11.7 The life cycle of a fillout form.
EXAMPLE 11.3
<html>
<head><title>An HTML Form</title></head>
<body>
<big>
1
<form name="form1" id="form1"
action="http://localhost/formtest.php"
method="GET">
<p><fieldset><legend> All About You</legend></p>
Type your name here:
2
<input type="text" name="your_name" size="50" />
<p>
Talk about yourself here:<br />
3
<textarea name="comments" id="comments"
align="left" rows="5" cols="50">I was born...
</textarea>
</p>
 
Search WWH ::




Custom Search