<form> </form> |
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:
|
|
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:
|
|
Example | <form action='addName.asp' method='post'> <input type='text' name='firstName'> </form> |
|