|
Configuring
the Form
The first thing you will need to change, is
the content of your form tag itself. The <form>
tag needs to have at least two attributes, method
and action. If you don't already have the method filled
in, set it to POST. The value of the action attribute
needs to be:
http://www.brown.edu/cgi-local/eform.cgi
A correct form tag will look like this:
<form
method="POST" action="http://www.brown.edu/cgi-local/eform.cgi">
Once the form tag is correct, two additional tags
need to be added. On the next line after the above
form tag, add two hidden input tags. They will look
like this:
<input type="hidden" name="_send_email1"
value="[SEE BELOW]/email.txt">
<input type="hidden" name="_browser_out"
value="[SEE BELOW]/output.html">
The only thing to change in the above tags is the
SEE BELOW part. First, write down the URL to your
form page. Replace [SEE BELOW] with everything in
between http://www.brown.edu and the form page name.
For example, if this page were going to have a form,
the URL to this page is: http://www.brown.edu/webmaster/webpublishing/eform.cgi,
so I would replace [SEE BELOW] with /webmaster/webpublishing,
and my finished tags would be:
<input
type="hidden" name="_send_email1"
value="/webmaster/webpublishing/email.txt">
<input type="hidden" name="_browser_out"
value="/webmaster/webpublishing/output.html">
Your tags will be different, as they need to use
your URL.
Before the form is ready to be published, two more
files need to be created, email.txt and output.html.
The purpose of email.txt is to serve as the template
for the email sent when the user submits the form.
The purpose of output.html is to be what the user
sees after submitting the form. Typically, this is
a "thank you" screen.
Email.txt
This is the email template the script will
use to send the user's results. It is important that
all your form elements were named. These names are
how eform pulls the information from the form.
In this file, put your form element name inside square
brackets [ ], and the script will replace it with
the user response. A form element can be a textfield,
radio button, checkbox or any other of these items.
Open a simple text editor (SimpleText or Notepad)
and name it "email.txt". The first line
in this file will be where the user results are sent.
The "To:" is required.
Example:
To:
Webpublishing@brown.edu
Next, put in where the email is coming from.
If your form gets the user's email address, use that
here. Remember, to use information from the form,
put the element's name in square brackets.
Example:
From:
[email]
The script will look through your form for
an element named "email" and replace with
what the user entered.
If you want a subject to the email, you can do that
next. The value can be something you just type in
or also taken from a form element.
Example:
Subject:
Form Results
Then, simply skip a line, and type in the body of
the email, using form element names in square brackets
where you want the user input to appear.
Example:
Hi,
my name is [name] and I would like more information
on [subject]. Could you please send that to [email]
or contact me at extension [phone].
[name], [subject],[email] and [phone] would
have needed to be the names of elements in your form.
Complete example:
To: Webpublishing@brown.edu
From: [email]
Subject: Form Results
Hi, my name is [name] and I would like more information
on [subject]. Could you please send that to [email]
or contact me at extension [phone].
Save this file (as email.txt) and upload it to the
same directory that your form page is in.
Output.html
This will be the page the user sees after submitting
the form. This file is just a typical web page, nothing
more special about it. If you do want to get a little
bit fancy, you can use the form elements in this page
the same way you did in the email.txt file. For example,
if you wanted to thank your user by name, and the
form has a name field, you could add this line in
the output.html page:
Thank
you [name], we will get back to you on that request
for [subject].
Once this page is completed, save it as output.html
and upload it to the same directory as your form page
and email.txt file. Now go test it out!
|