Welcome to FormGenics.com!

FormGenics is a HTML Form code generator. It creates the necessary HTML and JavaScript code for any form that you create using the easy question and answer styled wizard.

What kind of forms can you create with FormGenics? You can create email contact forms, membership sign-up forms, log in forms, application forms, cool HTML forms, download forms, comment forms, polls, support ticket forms, simple forms, complex forms...

If you have ever had difficulties creating a HTML form or are just too busy to write one from scratch, then you are in the right place!

Easy, simple, and free. Click here to get started right away or quickly view the Quick Start Instructions. For more advanced help, check out the Comprehensive Help Guide and our Support Forum.

create form
support forum
terms of use
Quick Start Guide
Comprehensive Help Guide
Support Forum

Back to Basics
Forms Part 1
Back to Basics
Advanced Forms Part 2
Back to Basics
Form Tips & Tricks Part 3
Designing Consistent Form Field Sizes
Getting the Most Out of Your Form
Form Processing - Working with CGI



Making Your Forms

Work with CGI Scripts

how to set up an HTML form and make it interact with a server side script
by Judy Fontanella

Forms Add Function to Your Web Site

Forms are an important part of Web design because they allow us to collect data from our visitors. Forms can add interactively to our Web pages and perform a lot of useful functions.

Making Forms Work

In order to create forms, you have to know how to put the form elements on your page. This comes as a learned part of web design. However, whether you're just building a contact form for a small personal website, or for the latest O2uk Broadband applications, it needs to be solid. A knowledge of where things go and how to implement them is crucial. There is another important part to creating forms: that is making the form work with a script that will take the data entered by your visitors and process it in some way. Your choice of a script depends upon the purpose of your form. Some forms interact with a JavaScript that is coded into the Web page and is run by the visitor's browser. The large majority of forms are processed by a script that is resident on a remote server, however. When the user fills in his data and then clicks the submit button, the data is sent to the script whose address is coded into the form tag.

The script that the form results are sent to may be on the same server as your Web site, or on another server. Frequently, the script is a CGI (Common Gateway Interface) script that is written in PERL, an ASP (Active Server Pages) script or a PHP (Personal Home Page) script. The script can take the data submitted by the form and add it to a database, send it by email to an address indicated, or return search results based on the user's input. Each script is unique and written to perform specific functions.

Even if your website host does not provide a form processing script, you can use a remote-hosted script to add interactive forms to your site without having to know any CGI or Perl.

Often, when you sign up with a hosting service to host your Web site, they will provide one or more CGI scripts located on their servers for your use. The most often provided type of CGI script is a form processing script that will take the information that is input by a visitor to a Web site and email it to the Web site owner. The hosts usually also provide good instructions on how to make your forms work with their scripts. It's generally just a matter of adding the correct address of the script to your form tag and a few hidden form fields to the form. These hidden form fields are invisible to your visitors. They don't display on your Web page. They are present in the HTML code, though, and carry important information back to the script, such as the email address that the form results should be sent to. In your HTML code, a hidden form field looks like this:

<input type="hidden" name="
your_email_address" value="[email protected]">

Making Your Form Work with a Remotely-Hosted Free CGI Script

Just in case your host does not provide a form processing script, all is not lost. You can use a script that is provided for anyone to use freely, as long as they are willing to view a little advertising. There are several such scripts available, but I am going to use the one at http://www.response-o-matic.com as an example. Once you understand the process of making your form work with one script, it will be easier for you to make it work with others.

To send the script to the Response-O-Matic server for processing, you must add the script address to the form tag like this:

(Your other form fields go here.
Include your submit buttons at the end.)

Notice the method=post attribute in the form tag. Some scripts use method=post. Others use method=get. Be sure to follow the instructions for your script. The Response-O-Matic script uses method=post.

Now, there is one other thing you must add to your form to make it work with this particular script. That is the hidden field that tells the script where to send the form results. The hidden field can go anywhere you would like as long as it is between the opening and closing form tags. Now the HTML code for your form looks like this:

<input type="hidden" name="your_email_address"
value="[email protected]">
(Your other form fields go here.
Include your submit buttons at the end.) </form>

Be sure to substitute your actual email address for the part that is in red. Adding Extra Options to Your Form

Thatís all that is required to make your form work with the Response-O-Matic script. Easy, isnít it? The folks at Response-O-Matic wanted to provide you with more options than this, however, so, they added a lot more optional fields that you can add to your form if you want to.

Two of the optional fields are visible fields into which the visitor can type their name and email address. If you name them the exact names that Response-O-Matic specifies, the visitorís name and email address will be placed in the "From" section of the email thatís sent to you. This makes it much easier to add this visitor to your email address book or to send them a reply. If you were to add these two fields to your form, your code would look like this:

<input type="hidden" name="your_email_address"
value="[email protected]">
Name: <input type="text" name="visitor_name">
Email Address: <input type="text"
(Your other form fields go here.
Include your submit buttons at the end.)

The rest of the optional fields are all hidden fields. They allow you to specify such things as the subject of the email message that you receive, which fields your visitor must fill in before the form will submit, and the appearance of the Thank You page that follows the form submission. For instance, if you wanted to specify the subject of the email, you would add a hidden form field named "email_subject_line". Your code will now look like this:

<input type="hidden" name="your_email_address"
value="[email protected]">
Name: <input type="text"
name="visitor_name"> Email Address: <input type="text"
name="visitor_email_address"> <input type="hidden" name="email_subject_line"
value="Conference Reservation Form Response">
(Your other form fields go here.
Include your submit buttons at the end.) </form>

Of course, you would substitute your own subject line for the part that is in green.

Some Things to Keep in Mind When Working with Forms

Here are some extra points to remember when creating forms:

All of your form elements, including your hidden form fields, MUST be between your opening and closing form tags in order to work. Only one set of form tags per form is allowed.

If you are using a table to layout your form elements, it helps if you put the whole table inside the form tags. That way you won't have improperly nested elements.

Each form processing CGI script is written a little differently. The names that they give to similar hidden form fields may be different, and the number of required hidden form fields may vary. Therefore, when you change the CGI script that you are sending the form results to, you must also change your hidden form fields as well as the script address that is in the form tag. Be sure to type in the name of the hidden fields exactly as the instructions indicate. The names are case sensitive.

Be sure that you give each of your other form fields a descriptive name that you will recognize when you receive the email telling you how your visitors responded to your form. It's a lot more informative to receive the results of a form that say:

Chicken: yes
Beef: no
Soup: yes

Than it is to receive form results that say:

c1: yes
c2: no
c3: yes

© 2000, Judy Fontanella. All Rights Reserved

forum  |  contact  |  articles  |  donate  |  privacy policy  |  site map  |  link to us
copyright ©2011 FormGenics.com | all rights reserved