This is a paired tag.

All form field elements must be enclosed between the tags in order to pass the information back to the server.  Additionally, form fields will not be visible in Netscape Navigator unless enclosed between the tags.

In order to use the tag to submit information, there are two attributes that will need to be used: action and method.

action attribute This attribute specifies the process on the server that will accept the information in the form.

In the early days of web development, the action was the name of a program that would be executed on the server.  The program was written in either C++ or Perl script, and was know as CGI, or Common Gateway Interface.  CGI is simply a specification that defines how information is passed to the server.   Based on the specification, the CGI program would know how to retrieve the information for processing.

Today, the old CGI process has been replaced by what's known as Server Pages.  A Server Page is simply an HTML document that has code embedded in the HTML.  There are two types of Server Pages:

  1. ASP - Active Server Pages.  This uses a subset of Visual Basic and runs strictly in Microsoft Internet Information Server (IIS) and it's variants, which includes Personal Web Server (PWS).
  2. JSP - Java Server Pages.  This uses Java and requires a special piece of software to compile and execute the pages.  The software is an extension of the Web Server, and you can usually find one that will work with any Web Server.
method attribute This attribute specifies how the information will be passed to the process specified in the action attribute.

The two methods for passing information in a form are:

  1. get - This method will append the information from the form fields onto the end of the URL as name/value pairs.  For example, if you have a text field named "firstName" containing the name "Joe," and the form is calling an Active Server Page called "addName.asp" as it's action, the URL would look like this:  http://www.someserver.com/addName.asp?firstName=Joe.  Note the question mark after the action name.  There is a limit of 1024 characters when using the get method.  Also, all name/value pairs will be visible in the Location/Address bar of the browser, which limits security.
  2. post - This method will pass the information as a separate file.  In this manner, there is no limit to the amount of information that can be passed to the server.  This is the method used by sites that allow you to post a picture.
Example <form action='addName.asp' method='post'>
<input type='text' name='firstName'>