WebHints: Forms

Fill-in forms allow the user who is browsing an HTML document to fill in the fields of a form and transmit the completed form to the WWW server where it can be processed. Forms provide a flexible way for those browsing webs to convey structured information to those operating the web. Here is an example of a form:

Name:
Email:
Phone:

Form constructs such as the above are expressed as follows:

<FORM ...>
   Elements in the form
</FORM>

Form constructs cannot overlap or nest.

When someone fills in and submits a form, the information is transmitted to the server as a series of bindings between field names and field values (provided by the user). For example, if the above form were completed, the information might be transmitted to the server roughly as follows:

   Email: sloth@sloth.com
   Phone: +1 (000) 0000-000
   Name: David Sloth

The manner in which this information is transmitted to the server is determined by the "..." part of the FORM construct (see above), is server-specific, and is beyond the scope of these web hints. Talk to your service provider to find out the details of how to wire up the back-end processing. Depending on how your service provider has organized things, it may take just a line or two of HTML to set up a form whose results will be emailed directly to you.

The elements of forms themselves are quite portable. Form elements are divided into three syntactic classes. The reason for this division is not clear to me. A description of the various elements appears below.

Once you've constructed a form, you need to add special fields to the form to indicate to your webserver how the form should be submitted and processed. It's possible to set up all kind of back-end engines to process the form in complicated ways. However, in most applications there is no need for such sophistication; just getting the information into someone's email in box is good enough. The following link refers to an explanation of how to add fields to a form on the IPA server so that the form will be emailed to a particular email address when the form is submitted.



* * Webmaster: ross@ross.net
Linkhere: Click here to find out how to link here.
Copyright: Copyright © Ross N. Williams 1995-1996. All rights reserved.