Creating a Form

 

by Virginia Bruce
Team Web

 

 

  1. After deciding what needs to go into your form, make a layout sketch. Then create it in Dreamweaver.
  2. Create a table to contain your page. Explanatory information can go above the form, or inside it. Save the page (save early, save often).

    Insertà form. This creates the form tags that enclose the form items.

    Then, clicking inside the red dotted box that appears, create another table inside the form to align the form elements. You’ll determine the number of rows and columns by the layout sketch you’ve made.

    Insertà form object to create the various form elements. A distinct Properties window will appear for each object. Each form object must be named. Give them names that make sense — no spaces, no symbols.

    Text box — for the user to input text. May be one line or multi-line.

    Button — the buttons at the end of a form are made with this — you can only select submit, reset, or none for the action, and the text that appears in the button.

    Check box — this allows multiple selections. It may be checked or unchecked when the form appears. The checked value must be entered.

    Radio button — this is an either/or button, only one of the array may be checked. Each button in a group must have the same name, and the value selected is what is returned.

    List/Menu — this is how you create pop-up menus or lists. A pop-up typically only allows one selection, a list may allow multiple.

    Don’t worry about the other field types for now.

    Now create a "thank you" page that will be returned when someone submits the form. Then create a hidden field somewhere between the form tags that points to it.

    <INPUT type="hidden" name="nexturl" value="http://www.teamweb.com/thanks.html">

  3. When everything is to your liking, save the form page again. Now open BBEdit or another text editor to create the template to format the form output. You can’t do this part in DW because it inserts code that will make the template unusable. Open the example mailmerge template. Save as formname.dot, where formname is the filename you have given the form. The file may be saved loose in the directory with the other files, or in a separate directory. I call mine "cgi."

  4. Go through the template, putting your information in place of what’s in the template example. The email that is generated by the form is based on what you enter in this template.
  5. The general pattern for the template is

    Item: @fieldcontent@

    where "item" is the text that will appear in the email, followed by the result of the contents of each field.

    I.e., Name: @name@ will come out as Name: John Doe

  6. Keep going until all your form fields have corresponding items in the template.

  7. Now use Fetch or another ftp program to put the files on the server. Again, you can’t use Dreamweaver because it adds code that breaks the template. once the files are on the server, you have to set "permissions." This allows the user to "execute" the template. Set permissions like this
  8. owner group everyone

    read x x x

    write x

    execute x x

  9. You can also use the "save to ftp" function in BBEdit, but only after you have set permissions in ftp. You can’t do that in BBEdit, but once they’re set, they stay set even though you re-save the file.

  10. Test the form by filling it out online. The email should be set to you until everything is working fine, and you may want to include your email for a while even after you set it to your client. It almost never works perfectly after the first try!

  11. If you want required fields in your form, you will need to use a slightly different template. See me.
 

 

WWW Development Home | WWW Design Syllabus | Team Web Home