Davis Home Events Living Education Business Organizations Forums Government Davis Community Network


DCN Web Tools: mailform

DCN has a general purpose form response program that allows DCN users to use HTML forms in their web pages and have form responses emailed to their DCN mail account. The program automatically decodes form input from CGI post format and organizes the responses by field. It can also check for empty fields and automatically display a specified web page when form submission is complete.

If you generally know how to use forms, you may use the mailform script by constructing your HTML form command like this:

<FORM METHOD="POST" ACTION="http://www.dcn.davis.ca.us/cgi-bin/mailform">

And putting one or more special fields into your HTML form. They may be HIDDEN if you don't need the user to fill them in. They are as follows:

TO
Optional: An email address to receive the results. For example:
<INPUT TYPE="HIDDEN" NAME="TO" VALUE="you@dcn.davis.ca.us">
If this field is omitted, the mailform program will try to determine an email address from the directory information of the referring page.
SUBJECT
Required: What the subject should be on the mail message. For example:
<INPUT TYPE="HIDDEN"" NAME="SUBJECT" VALUE="Subject Line">
REPLY-TO
Optional: Who should be listed in the "From" field of the mail message. For example:
<INPUT TYPE="HIDDEN" NAME="REPLY-TO" VALUE="name@site.com">
REQUIRE-REPLY
Optional: If this field is present, the REPLY-TO field becomes required. For example:
<INPUT TYPE="HIDDEN" NAME="REQUIRE-REPLY">
NEXT-PAGE
Optional: URL of web page to show on successful submission of form. For example:
<INPUT TYPE="HIDDEN" NAME="NEXT-PAGE" VALUE="local url">
CHECK-EMPTY
Optional: Put this in to turn on requirement that no fields be empty. For example:
<INPUT TYPE="HIDDEN" NAME="CHECK-EMPTY">

You may also require that any particular field be filled in by using a field name with a leading "X-". For example, to make the field SUBJECT a required field, change its name to X-SUBJECT.

The following is an example of complete form much like the DCN feedback form. Note that it has additional fields like name and content that are the real heart of the form. These are in addition to the fields used by mailform.


<HTML>
<HEAD>
<TITLE>Sample mailform Feedback Page</TITLE>
</HEAD>
<BODY>

<H1>Please use this Form to send Feedback and Suggestions</H1>

<HR>

<FORM METHOD="POST" ACTION="http://www.dcn.davis.ca.us/cgi-bin/mailform">

<INPUT TYPE="HIDDEN" NAME="TO" VALUE="msmosaic@dcn.org">
<INPUT TYPE="HIDDEN" NAME="NEXT-PAGE" VALUE="/~steve/thanks.html">
<INPUT TYPE="HIDDEN" NAME="REQUIRE-REPLY">
<!-- INPUT TYPE="HIDDEN" NAME="CHECK-EMPTY" -->

Enter Your Name Here: <INPUT NAME="X-NAME" SIZE="40"> 
<P>Enter Your E-mail Address Here:
<INPUT NAME="REPLY-TO" SIZE="40">

<P>Enter the Subject Line Here:
<INPUT NAME="SUBJECT" VALUE="WWW Feedback" SIZE="40">
<P><P>Message:
<P>
<TEXTAREA NAME="CONTENT" ROWS=10 COLS=40 WRAP=VIRTUAL>
</TEXTAREA>
<P>

<INPUT TYPE="SUBMIT" VALUE="Submit Your Comments">
<INPUT TYPE="RESET" VALUE="Reset All Fields">
</FORM>

<HR>

</BODY>
</HTML>


Homepage | Contact DCN | Contact DCN Web Team

Copyright © 1996-2005 The Davis Community Network
URL: http://www.dcn.davis.ca.us/tools/mailform.html
Last Revised: August 16, 2004