[Forms]Forming Forms


FORMing Tags

The <FORM>...</FORM> tags allow readers to interact with your Web pages and to send information (including files) to you.
The <FORM>...</FORM> tags and their attributes are used to define forms in a Web page. When a Web browser submits a form to a server, the server receives the information as a request to execute a CGI script. CGI stands for Common Gateway Interface and is simply a method of passing data between a browser and a server.
Different servers have different CGI scripts which can call other programs to perform different tasks such as checking the validity data in the form, searching a database, doing calculations on different fields in the form, or any number of other tasks.

Submitting A Form

What happens when a form is submitted? Let's take the process step-by-step:
  1. A user fills out an electronic form and clicks the "SUBMIT FORM" button. Somewhere in the electronic form is the name of the CGI script to run (generally in the /cgi-bin/ directory and the script generally has a .cgi extension). The script exists at a Web server.
  2. The browser requests a URL from the server (being what browsers do). The URL points to the script on the Web server (for example /cgi-bin/generic.cgi).
  3. The Web server receives the request, notes that the URL points to a script, and runs the script. The script performs some action (it depends on what the script is meant to do). Generally, the script will generate some kind of output that can be understood by the Web server.
  4. The Web server gets the output from the script and performs some action (it depends on the output). For instance, in the game registration survey below, the Web server will e-mail the completed form to me, then send the user that filled out the form a message saying that the form was sent.
Again, different Web servers have different scripts which can perform different tasks. When you are creating forms for the Web, check with your ISP to see what options you may use.
Forms can can be created to take orders for products or services, do surveys, or just get feedback on something. The applications for forms on the Web are just about endless. One drawback to simple forms is that they only accept information. There is no check to see that the information being entered in each field is valid. Forms on the Web appear to be exploding and changing quickly. JavaScript also allows users to complete forms and authors to run a validity check on the data after the form is filled out and before it is sent back to the Web server, speeding up the process (less interaction with the server) and giving better qualit data. There are programs that can be run from on the Web server to perform the same tasks, but again, you need to contact you ISP to get the names of the programs, the programs parameters, and test fully to ensure a quality interface.

Sample Forms

The following 3 examples give an idea of the types of layout that are possible:
  1. Form Tools: A list of types of fields available and the code behind the scenes
  2. Game Registration: Register a product and comlete a survey
  3. Order taking: A form to order output from a service bureau

Return Of The Data

What do you get for your effort? If your script is returning information to you, the result is a text file (or possibly the user sent an electronic file as in the instance of the service bureau form). The result may also be to take the user to a different Web page, show the user the result of a search, or perhaps to prompt the user to correct some of the fields in the form.
[Top] [Back] [Next]
©Ken Kaleta 1997, 1998, 1999