You can use Dreamweaver to set up forms which to take and process
input. In order for forms to work, they must call on a computer program,
called a script, to process that input. Lehigh has a few scripts set
up on the main server. If you want to use other scripts, you will
need to run them from another site or look into using space on cgi.cc.lehigh.edu
(see the Advanced Web Authoring
Seminar for more information).
Most people will be using the Lehigh form-processing script
(pquery), unless they are using form-processing scripts from
other servers. So we will be using the Lehigh form processing
script, which simply takes input from the form and emails it
to a specific address, as our example.
First, you have to set up the form: Choose Form from the Insert
menu:
The form will appear as a box outlined in dotted red lines:
Then you must set the properties of the form. Clicking inside
on the red dotted line around the form makes the Properties
panel display the form properties:
The Method should be Post; the Action is the URL (web address)
of the form processing script, in this case: http://www.lehigh.edu/cgi-bin/pquery
You can put a name in the 'Form Name' field, but our forms
processor doesn't use it.
Inside the form, you will need to put fields. To insert
a field, from the Insert menu, choose Form Objects, then
the type of field you want:
After a field is created, you have to set its properties,
including name and, if necessary, value.
Setting up a form to use the form processing script
Lehigh's form processing script, pquery, requires a number
of fields to be present in every form: FORMNAME, RECIPIENT,
and SENDER.
To insert the FORMNAME field (which should generally be
a hidden field, and isn't the same as the 'Name' property
of the form): Click inside the form. Choose Form Object from
the Insert menu, then choose 'Hidden Field'. Click on the
yellow tab that appears and change the properties so that
the field name (under HiddenField) becomes FORMNAME and the
value is the name you want your field to have (this will
be the header of the e-mail that is sent with the contents:
To insert the RECIPIENT field (which should generally be
a hidden field): Click inside the form. Choose Form Object
from the Insert menu, then choose 'Hidden Field'. Click on
the yellow tab that appears and change the properties so
that the field name (under HiddenField) becomes RECIPIENT,
and the value is the e-mail address that you want the form
contents sent to:
You will need a SENDER (the e-mail address of the person
filling out the form) field, but you will want that filled
in by the user. So you will have to add some information
in the field, such as 'Your E-mail address:' and follow it
with a visible field. You can type inside a form (type inside
the red lines) as you would normally. Then to insert the
SENDER field, click where you want the field, and choose
Form Object from the Insert menu, then select 'Text field'.
You will want to fill in the form's name as SENDER. You can
set the width to be the width of the usual Lehigh e-mail
address (17 characters) and give an initial value that looks
like a complete e-mail address to encourage people to fill
in their complete e-mail address.
Now you just add fields and text to complete your form.