Creating Web FormsThe basic construction of an HTML form is this...
All forms use the Method and Action attributes. In order for a form to function, it first needs to know how to send the information to the server. There are two methods: GET and POST with GET being the default method.
In addition to a form needing to know how to send the information, it also needs to know where to send the information to be processed. The ACTION attribute contains the URL to the form processing script or program. It can also be an email address.-Caution! Example Form:
Here the form is sent to a cgi script for processing. Most forms these days use php or Perl scripts for form processing. Example Email Form:
The drawback to this method is that it will not work with all browsers and that email harvesters will most likely harvest the email address it is no longer considered to be a good choice. (see hiding email addresses). You should note that when the ACTION attribute references an email address, you don't have to include the METHOD attribute (i.e. POST or GET). Form LayoutIn order to specify the appearance and layout of the form we use another HTML element the INPUT tag. The input tag, like it sounds, allows your visitors to input data to your Web server. The INPUT element has the following attributes that may be used:
There are ten specific types of INPUT tag which are specified by using the
TYPE attribute:
This is shown below. The HTML code used to generate this form is also shown below.
Table structures can be used in web forms to improve layout and even add colour. Web forms often use a two column table structure with the filed names in the left column and the data being entered in the right column. Figure below shows the use of tables to layout forms.
The HTML code is also shown below:
Using FrontPage to Create FormsFrontPage can be used to create and layout forms but care should be taken to ensure that the forms don’t rely on FrontPage extensions being available unless of course you intend it that way. When creating forms using the forms Wizard then you should at some stage be prompted to enter the form handler, If you don’t intend to use the FrontPage extensions then choose external for the form handler. If the HTML generated by FrontPage has any references to a WebBot then it requires FrontPage server extensions to work correctly. If the server doesn’t support FrontPage server extensions it won’t process the WebBots and so the functionality they were meant to provide will be lost but otherwise the page should display. It is best however to remove them if they are not to be used. Although it may require manual editing it is far simpler to use FrontPage for the initial layout than to code the entire form manually. Keep Forms SimpleOnly ask for as much information as you really need. Many people will not fill out a long from but are willing to fill out a simple form that asks only for any email address. Once you have the email address then you can usually get more information later on. It is important to note that newsletter subscription forms are a special type of form and are created in conjunction with an autoresponder service provider like get response. See autoresponders for more detail. Form ProcessingWhen you click the submit button the form is passed to a form processor where the data is extracted and stored.-Processing Website Forms
|
||||||||