Test Form for formsend.cgi
written by Alex Hermann © 1999

Click here or scroll down for instructions on how to use this script
Buy a Dog for Life

Please state breed:


Select a Colour


Choose type:

Guide Dog

Hunting Dog



Select Qualities:

Good Dog

Bad Dog



Enter any comments below:

Please enter your personal details
Fields marked with an
* must be completed

* Your name:

Your business name (if applicable):

* Your Address:



County/State:

Country:

* Post Code / Zip:

Telephone :

Fax (if applicable):

* Your Email Address:

Payment Method

If you wish to pay by cheque, we'll email an invoice. Please note that we cannot proceed with a new domain registration until your payment has been received.

Type of card

If Switch, please enter issue number

Cardholder Name:

Card Number

Expiry Date



USER INSTRUCTIONS

What does this page do:

It collects information which your visitor enters and uses JavaScript to check that mandatory fields contain text, then validates the email address and credit card number before sending this data for processing to the program formsend.cgi.

Can I use this form page on my web site:

Yes. This page would have been added to your web space when your account was created. If you deleted it, email us for another copy or click on 'View Source' and copy and paste the code into Notepad/Simple Text and save it as form.html. Redesign this page to match the rest of your site, but be careful not to change the code between the <SCRIPT LANGUAGE="Javascript"></SCRIPT> tags and the <FORM ACTION=> tag.

How do I add additional text input fields and get JavaScript to check they contain text:

Enter the following into your html where your input field should appear: <INPUT TYPE=text NAME=Name_of_field VALUE="" SIZE=25>

Then add the following into the code AFTER this line of code: function FormValidator(theForm) {

//----Begin check if input name "Name_of_field" contains data

if (theForm.Name_of_field.value==""){

alert("Please enter your details")

return false }

//----End checking if input name "Name_of_field" contains data

IMPORTANT: Each input field must have a different name and you cannot use the dash as in Name-of-field, because it will be interpreted as a minus character - Use the underscore instead.

How do I delete code from the JavaScript function:

If you do not need to check the Post Code field or your form does not have such a field, open this file in a text editor such as Notepad or Simple Text and look for the block of code which looks like this:
//----Begin check if input name "post_code" contains data

if (theForm.post_code.value==""){

alert("Please enter your post code - must be the same as your credit card's billing address")

theForm.post_code.focus(); //----This places the cursor into the field

return false }

//----End checking if input name "post_code" contains data

Simple just delete this block and save and upload the file into your public web directory.

What does the program formsend.cgi do:

It collects all form field information entered by your visitor from a web page such as this and emails this to you, then opens the file formsend.tmp and collects the html for your confirmation or thank-you page and prints it to the browser.

How do I use this script:

FTP into your account and enter the directory named cgi-bin, then download the following two files to your computer: formsend.cgi and formsend.tmp. Open the file formsend.cgi in a TEXT editor such as Notepad or Simple Text. You cannot use a desktop publishing program to edit this file. Look for a line which looks like this: $recipient = 'info@gohot.co.uk'; Carefully replace our email with your email address, making sure you leave the inverted commas in place. Save it and upload it back into your cgi bin and make sure it is called formsend.cgi. Design a thank you or confirmation page which you would like to display after your visitor submitted the form and save the HTML into the file formsend.tmp. Upload this file into the cgi bin and make sure it retained its file name formsend.tmp.

This program handles unlimited amounts of form input fields and can be used from your normal web space or your secured web space and if you duplicate and rename both files, you may set up an unlimited amount of forms from your site.

If you don't have enough understanding to install your form and formsend program as well as set up JavaScript field validation, we can do it for you for a fee of £40.00. We could also modify this script to write input data to a log file and send email confirmation to your visitor for an additional fee of £20.00. Email us at scripts@gohot.co.uk for more.

How should the <form Action> tag look:

If you are using this script for a form which does not require to be served from a secure server, the tag should look like this:
<FORM ACTION="/cgi-bin/formsend.cgi" METHOD=POST onsubmit="return FormValidator(this)">

You can have as many forms as you need pointing to the same script, but if you must have a customised thank-you page with each form or need to mail different form data to different email addresses, you can make copies of the script and template files and place them into additional folders within your cgi bin. If you have a form on your site taking survey details, place both script files into a folder named survey - the tag should then look like this:

<FORM ACTION="/cgi-bin/survey/formsend.cgi" METHOD=POST onsubmit="return FormValidator(this)">

IMPORTANT: If you duplicate the script and upload additional copies, you must set permissions for the file formsend.cgi to 755. All scripts must be placed into the CGI BIN.

 

Email us at scripts@gohot.co.uk if you are experiencing problems. Please bear in mind that we cannot offer support for html or JavaScript coding - if you are not familiar with either, we suggest you employ our programmer. It should not cost you more than £40.00 to have your form fully functional.


This page and its code is copyright material © Gohot 1997 - 2002
You may only use it if you are a subscriber to Gohot, Opus Direct, SoundPunch, X9 Internet, Rothco Media or any company associated with the Rothco Group.