background

Creating Forms for the Web

In order to create a web form that works, you not only need to create a web form, but direct that form to send the information to the e-merge CGI script, which then looks for the merge.txt file that you create that tells it what to do with the information.After the form has been submitted you can also create a “Thank you” screen, called the display.txt file, that lets the user know that they have successfully sent their information. The basic process is as follows:A. Create a form using HTML:

  1. Use Dreamweaver to create basic form elements
  2. Never put spaces in any web file names
  3. Only use letters and numbers in file names
  4. Layout your form and name your variables FIRST
  5. Use simple names for all form objects

Simple Form Example:

Complex Form Example:

B. Create a merge.txt file for your form:

  1. Include all variables in the form of an email message
  2. Can be done in Dreamweaver, saved as .txt file
  3. Place variable names in brackets: [variable]

C. Create a display.txt file for your form:

  1. This is a simple web page that appears after submission
  2. It is important to tell the user the submission worked!
  3. Can be done in Dreamweaver, then saved as .txt file
  4. Place variable names in brackets: [variable]
  5. (to make your feedback customized!)

D. Connect your web form with e-merge:

Edit your HTML form to tell it what action to take:
<form name=”name” method=”post” action=”http://abacus.bates.edu/cgi-bin/e-merge
/path to files/merge.txt&display=
/path to files/display.txt”>
“name” = a name for your form (whatever makes sense)
/path to files/ = location on abacus of merge.txt & display.txt

E. EXAMPLE URL FOR FORM:http://abacus.bates.edu/~rrichar2/form/

F. EXAMPLE FORM TAG:

<form name=”formTEST” method=”post” action=”http://abacus.bates.edu/cgi-bin/e-merge
/~rrichar2/form/merge.txt&display=
/~rrichar2/form/display.txt”>
G. Publish all three files to the same web directory:

  1. index.html (HTML form), merge.txt, display.txt
  2. Never put spaces in any web file names
  3. Only use letters and numbers in file names
  4. Be sure permissions are set so that others may read

H. Test your work:

  1. Try every different combination of responses
  2. Be sure that your variables are coded correctly
  3. Always make sure the merge.txt file has your email address in it for testing purposes!

  • Categories

  • Tags

  • Contact Us

  • Help Desk Hours
    Help Desk Services at Ladd Library Mon-Thu: 8am-1am, Fri: 8am-8pm, Sat: noon-8pm, Sun: noon-1am