JavaScript EditorDebugger script     Dhtml css 



Team LiB
Previous Section Next Section

Starting the Form

The FORM element brackets all other elements included within your form and specifies the method and action to be used when submitting form data. Add a FORM element to the document:

<form method="post" action="/cgi-bin/FormSend.pl">
</form>
<hr>
<address>

The METHOD attribute specifies the HTTP method used to submit the form data. Two values are allowed: post and get. The default is the get method, but the post method is normally used for submitting form data (whereas the get method may be used for making online database queries, for example). With the get method, you are limited to sending only about 128 characters, which is why the post method is normally used to send form responses.

The ACTION attribute specifies the agent used to process the form data when it is submitted. For forms published to the Web, this should be a CGI script, which is a server-side script that resides on the server. This type of form is commonly called a CGI form. CGI stands for Common Gateway Interface, which is the protocol that allows users on the Web to access and run server-side scripts and programs over the Web. Until recently, most browsers also supported using what is called a mailto form. A mailto form uses the user's mail program to send a form response directly to their e-mail address. Current browsers, however, have dropped support for using mailto forms, so these types of forms should only be used locally to test sending and receiving form responses, but should not be published to the Web.

The example points to a fictitious CGI script, FormSend.pl (the .pl file extension signifies that it is a script written using the Perl programming language, which is commonly used to create CGI scripts). To create a functional form, you would need to specify an actual CGI script that you have access to on the Web. For further discussion of using form processing CGI scripts, see "Creating CGI Forms" later in this session.


Team LiB
Previous Section Next Section


JavaScript EditorDebugger script     Dhtml css