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).
<head><title>An HTML Form</title></head>
<form action="/cgi-bin/bookstuff/form1.cgi" method="post"><p>
<fieldset><legend>All About You</legend>
Type your name here:
<input type="text" name="namestring" size="50" />
<b>Choose a work place:</b><br />
<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