- Nov 29, 2002
This hour covers the following topics:
Understanding HTML forms
Creating a form
Using the form object to work with forms
Getting data from a form
Sending form results by email
The Basics of HTML Forms
Defining a Form
An HTML form begins with the <form> tag. This tag indicates that a form is beginning, and it enables form elements to be used. The <form> tag includes three parameters:
METHOD is either GET or POST; these are the two ways the data can be sent to the server.
ACTION is the CGI script that the form data will be sent to when submitted. You can also use the mailto: action to send the form's results to an email address, as described later in this hour.
For example, here is a <form> tag for a form named Order. This form uses the GET method and sends its data to a CGI script called order.cgi in the same directory as the Web page itself:
<form NAME="Order" METHOD="GET" ACTION="order.cgi">