|
|
 |
Steps
- Determine what information your form will collect.
- What are the field names? Which are required fields and
which are optional?
- Will the info be written to another Web page, a database
file, or sent via e-mail?
- Using the text or HTML editor of your preference, create
a new file, and add the basic HTML tags (
<html>, <body>, etc.). Inside the opening <body> tag, add a <form> tag. This will normally look
like this:
<form method="post" action="/htbin/ponyexpress2">
Before the closing </body> tag, add a closing </form> tag so you don't forget to add this
later.
- Add text fields, selection menus, buttons, etc. for each piece
of information you want to collect. Make sure each element has
a distinct NAME attribute, and where appropriate a VALUE (e.g. radio buttons):
Your school: <input type="text" name="school">
- Below the opening <FORM> tag, add the special "hidden"
tags used by PonyExpress:
<input type="hidden" name="to" value="youraddress@bu.edu">
<input type="hidden" name="subject" value="Comments on site">
<input type="hidden" name="return" value= "http://www.bu.edu/yoursite/thanks.html">
<input type="hidden" name="order" value="lastname,firstname,email,
phone,department,comments">
<input type="hidden" name="required" value= "lastname,firstname,email,
comments">
In addition to the above tags, you will often include other
hidden tags depending on what your form will do. Refer to the special tags page.
- Don't forget to add a <SUBMIT> button so users can send
their information and a <RESET> button so that they can
revert their answers back to the defaults:
<input type="submit" value="Submit">
<input type="reset" value="Reset">
- To test your form, you will need to upload it to the server.
FTP to webdev.bu.edu (departmental sites) or people.bu.edu (individual sites) and upload the file.
Access the form on your site using your Web browser. You should
now be able to fill out and submit your form and receive an
instant e-mail containing the unformatted form data. It is often
helpful to keep an active FTP session open while you make any
needed changes to your form, so that you can quickly modify
and reupload the form during testing.
- Create the template files you will use. To format e-mails these
will be the admin.message and/or visitor.message.
To format Web page output, you will create an output.template file. Refer to the templates page.
You may have to update the preferences in your text editor (e.g., Dreamweaver) to view and edit .message and .template files. For information on modifying Dreamweaver's preferences, visit Configuring Dreamweaver.
- Use FTP to upload the templates into your form directory. Make
sure also that you include a "form_location" hidden tag
in your form and reupload it if you haven't already done so.
- You will need to create an output directory and activate
your directory in order to have your form write to a Web page
or datafile. You can do this before or after creating the actual
files in the directory. For departmental sites you will need to send us a request to
do this for you. We will usually process these requests within
one business day.
Individuals on people.bu.edu will activate their own directories
using the acledit command from ACS. Refer to the directory
activation page.
- Finally, make any revisions to your form fields and the page
layout and design before you link to the page. Submitting several
test forms and looking at the e-mail or Web page output can help
you refine your forms so they are both easier to use and collecting
the appropriate information from the visitor. This final stage
is obviously more important for large forms gathering lots of
highly specific data, and less crucial for informal guestbooks.
|