Using FrontPage with forms.cgi step-by-step
by the BigBiz Internet Services Webmasters
If you are a FrontPage user, you can design your forms using the
FrontPage editor. As an example we will duplicate creating the first
example form of forms.html
using FrontPage 98. We will present the HTML and the form
here as a reference:
This form lets you enter your name, and email address, and posts it to
the forms.cgi script. This form is configured to send the message
"Thank you for using forms.cgi" to the email address you enter. This
is just a simple demonstration of using forms.cgi to mailback form results.
The HTML code for the above example is as follows
<form action="http://www.bigbiz.com/cgi-bin/forms.cgi" method="POST">
Name: <input name=myname>
Email address: <input name=F_to>
<input type=hidden name=msg value="Thank you for using forms.cgi">
<input type=hidden name=yourname value="Your name is">
<input type=hidden name=F_fields value="yourname+myname,msg">
<input type=hidden name=F_subject value="forms.cgi test">
<input type=hidden name=F_from value="nobody@bigbiz.com (Form Test - Do not reply)">
<input type=submit value="Send">
</form>
We will show you step-by-step what to
do to achieve the same results as the above html.
- Create a new form, click on "New Page" in the explorer.
Then open the page in the Editor by double clicking on the new icon
- In the editor create the form on the page, use the form toolbar and
click on the one line text box. Frontpage will create a new form complete
with submit and reset buttons.
- Type in a heading "Name:" before the entry box (place cursor before
text box and type Name:).
- Put cursor after name text box and click again on the "one line text
box" icon to get a second entry textbox, label that one "Email address:".
- Now we need to set the names on the input fields, the name box should
be called "myname", and the email box should be called "F_to". Double-click
on the name box and you will get a dialog box "Text Box Properties". Type
in "myname" for the Name field and click OK.
Repeat for the email box and name it "F_to". The names are case sensitive,
so type it in exactly, "F_To", "f_to", etc... will not work.
- Now we need to add the hidden fields. Double click on the
submit button, then click on "Form...",
then click on "Advanced..."
to display the hidden fields dialog box.
- Click on Add to add each hidden field
- yourname, Your name is
- F_fields, yourname+myname,msg
- F_subject, forms.cgi test
- F_from, nobody@bigbiz.com (Form Test - Do not reply)
You can substitute your own email address for F_from if you wish. Click OK
when done.
- We need to send the form to our cgi script, so while we're on
the form properties dialog box, click on "Send to other", and leave
the selection "Custom ISAPI, NSAPI, CGI, or ASP Script".
Then click "Options..." to select the CGI script.
- In the dialog box enter the forms.cgi url (http://www.bigbiz.com/cgi-bin/forms.cgi) in the Action field. Method should be the default POST. Leave
encoding type blank. Then hit OK. Hit OK again for the form properties since
we are done with them.
- Now we can change the Submit button to display "Send" instead. Change
the "Value/Label" field to Send.
- [optional] You can delete the Reset button if you like. Click on Reset button, then
use menu Edit/Cut.
Thats it - you can save the page and try it out. If you are curious, click
on the "HTML" tab at the bottom of your FrontPage editor window and it will
show your page in HTML format - you will notice it should essentially
be the same as the example html above.
Note you can repeat these procedures to create the other more advanced
types of forms discussed later.
Tips: for FrontPage users, FrontPage has special features for forms validation.
You can set up each field to do some pre-validation before submitting, example:
you want to make sure Name is not blank, etc... Double click on the
input block and click on "Validate...". Refer to the FrontPage manual for
details on using this.