|Home||Pauline||Howto Articles||Uniquely NZ||Small Firms||Search|
|Howto Guide to HTML Forms|
Forms are very useful on a Web Site and are almost mandatory for a business site. Initialy they will be used for enquiries and latter on for orders to be placed. The HTML Tags to insert the various input "boxes" on a web page are not difficult and you can try it all out locally to see what it looks like. The difficulty comes in how to deal with the output of the Form and get it sent to you. This depends to a large extent on the ISP you are using to host your web site and what facilities they offer.
Before we start it is useful to have an overview of how a form is handled. Firstly there are a number of Tags for Input to the Form on the page which is downloaded from the server to the browser - all modern browsers such as Internet Explorer 3 or greater and Netscape Navigator 2 or greater handle Forms. The user enters text into the various Input "boxes" on the Form without any further communication with the server and they are held locally in various variables specified in the Input Tags. These can be called almost anything you like provided they are made up of alphanumeric characters and underscores such as my_name. There are two other Tags associated with a Form - the first specifies where the Form is sent ie another page or script (we will come to what a script is eventually) on the server. The Second tag actually sends off (Submits) the contents of the Form back to the place specified on the server with a list of all the variable names you defined in the Form and what their final Values were. We do not need to know details at this point of how they are encoded other than to know that they are compressed into a long string which then has to be interpreted in the page or script and then saved somewhere you can look at (ie another HTML page) or sent to you in a meaningful email message.
Now lets have a look what a typical form looks like and the tags used.
The Form Tag encloses the section comprising the form and also specifies the mechanism used to attach the variables and where it is sent when submited.
We have now looked at the most common Tags and how they are used to create a Form. There are a few more Tags and attributes available but those above should be sufficient to get one started. Forms need to be laid out well and Tables are useful for that. The <BR> and non printing space are also useful.
| Copyright © Peter and Pauline Curtis
Content revised: 29th October 2003
Layout revised: 30th June, 2015