HTML and CSS Reference
In-Depth Information
Figure 11.15 What went wrong? Watch your spelling! We tried to reference a form
by the wrong name!
11.4.4 Submitting Fillout Forms
Submitting an HTML Form Without JavaScript. When the u r cks a subm t
button, the form is normally sent to the server for further processing by another appli-
cation such as a PHP, ASP.NET, or CGI script. Before the server gets the form, its content
is gathered by the browser, URL encoded, and then sent to the address supplied in the
action attribute of the form. (In the previous examples, the action attribute was not used
because there was no reason to process the user input in the sample forms.) The appli-
cation on the server side decodes and processes the form information. From there, an
acknowledgment can be sent back to the user, an e-mail delivered, the processed infor-
mation sent to a database, or whatever else we define. Now let's look at an example of
an HTML form and how it is submitted to a server application. After the user fills out
the form, he or she will click the Submit button. The form data will be collected by the
browser as name/value pairs and sent to the server. The method attribute determines how
the data is sent (as a query string or message body) and the action attribute determines
where it will be sent (the URL of a server).
EXAMPLE 11.8
<html>
<head><title>An HTML Form</title></head>
<body><big><strong>
1
<form action="/cgi-bin/bookstuff/form1.cgi" method="post"><p>
<fieldset><legend>All About You</legend>
<p>
Type your name here:
2
<input type="text" name="namestring" size="50" />
</p>
<b>Choose a work place:</b><br />
3
<input type="checkbox" name="place"
value="LA">Los Angeles<br />
<input type="checkbox" name="place" value="SJ">San Jose<br />
<input type="checkbox" name="place"
value="SF" checked>San Francisco <br />
 
 
Search WWH ::




Custom Search