Help Desk
CGI: Form Mail with Required Fields Script
 
Web www.seanet.com
  1. Start the form with:

    <FORM METHOD="post" ACTION="http://www.yourdomain.com/cgi-bin/reqform">

  2. Add the e-mail address you want the form information emailed back to:

    <INPUT TYPE="hidden" NAME="mailto" VALUE="username@yourdomain.com">

  3. Add a subject line for the e-mail:

    <INPUT TYPE="hidden" NAME="subject" VALUE="the subject of the e-mail">

  4. Create the form fields. See examples below.

  5. Add Submit and Reset buttons:

    <INPUT TYPE="submit" VALUE=" Submit ">
    <INPUT TYPE="reset" VALUE=" Reset Form ">

  6. Optional: Indicate required fields:

    <INPUT TYPE="hidden" NAME="required_fields" VALUE="field names separated by commas">

  7. Optional: Add a custom acknowledgement page:

    <INPUT TYPE="hidden" NAME="acknowledge_page" VALUE="http://www.yourdomain.com/acknowledge.html">

  8. Optional: Add formating to the confirmation screen that the user sees before the form is submitted:

    <INPUT TYPE="hidden" NAME="form_title" VALUE="Title of Form">

    <INPUT TYPE="hidden" NAME="form_fontsize" VALUE="2">

    <INPUT TYPE="hidden" NAME="form_fontface" VALUE="Arial, Helvetica">

    <INPUT TYPE="hidden" NAME="form_message" VALUE="Please review the information you entered for accuracy.<BR> If you need to make a correction, click the BACK button.<BR> If the information shown is correct, click the OK button.">

    <INPUT TYPE="hidden" NAME="table_width" VALUE="50%">

  9. Optional: Add an e-mail back to the person filling out the form (all four of these lines must be done for this function to work):

    <INPUT TYPE="hidden" NAME="email_fieldname" VALUE="name of the field that contains the e-mail address">

    You must have a field in your form where the customer fills in their e-mail address for this to work. You may want to make this a required field.

    <INPUT TYPE="hidden" NAME="message_from" VALUE="ABC Company">

    <INPUT TYPE="hidden" NAME="message_subj" VALUE="Thank you message">

    <INPUT TYPE="hidden" NAME="message_file" VALUE="/thankyou.txt">

    The VALUE for message_file should be the full path to the file relative to the Web root.

  10. End the form: </FORM>

Commonly Used Form Input Fields

  • Checkboxes.
    I like zucchini.
    I like zebras.
    <INPUT TYPE="checkbox" VALUE=zucchini NAME="plant" CHECKED> I like zucchini.<BR>
    <INPUT TYPE="checkbox" VALUE=zebra NAME="animal"> I like zebras.<BR>
    

    VALUE is what is returned if the box is checked.
    NAME is how this checkbox will be referenced.
    CHECKED is included if the box should start off checked.

  • Radio Buttons.
    Jazz
    New Age
    Rock
    <INPUT TYPE="radio" VALUE="Jazz" NAME="Radio1">  Jazz<BR>
    <INPUT TYPE="radio" VALUE="New Age" NAME="Radio1">  New Age<BR>
    <INPUT TYPE="radio" VALUE="Rock" NAME="Radio1" CHECKED>  Rock<BR>
    

    VALUE is what is returned if the item is selected.
    CHECKED (optional) is the item that starts off selected.
    NAME is how this series of radio buttons will be referenced.

  • Text Fields.
    <INPUT TYPE="text" VALUE="Kilroy was here." NAME="text1" SIZE="12" MAXLENGTH="25" >

    VALUE (optional) is a default string to be displayed in the text field before the user types anything.
    NAME is how this text field will be referenced.
    SIZE (optional) is the amount of display space for the text field.
    MAXLENGTH (optional) is the length of one line in the text field. If MAXLENGTH is larger than SIZE then the text field should scroll as necessary.

  • Text Area Fields
    <TEXTAREA NAME="text2"  ROWS=10 COLS=60>Type something here.</TEXTAREA>
    

    NAME is how this text area will be referenced.
    ROWS and COLS define the size of the text area.

  • Password Fields.
    <INPUT TYPE="password" NAME="thepassword">

    NAME is how this field is referenced.
    When the user types in this field, no characters are displayed.


Seanet Internet Services
PO Box 2228
Seattle, WA 98111
Seanet Support Hours
8 AM - 8 PM Monday - Friday
10 AM - 5 PM Weekends - Holidays
206.343.7828
1.800.9.SEANET
(1.800.973.2638)