
| To write a web page which lets the visitor fill in some blanks is fairly straightforward. If you have an understanding of basic HTML programming then the form ability is a reasonably easy process. |
| An email form REQUIRES the name of the program which runs behind the scenes which actually processes all the blanks being filled in by the visitor. |
| <FORM ACTION="/cgi-bin/form-mail.cgi"
METHOD="POST"> is the correct line for this. |
| Next the email form needs to be told WHO to send the email to after the visitor depresses the submit button. |
| <INPUT TYPE="hidden" NAME="To"
VALUE="email@domain"> will do the trick. You must enter the email address of the person you want to receive the completed form. For example if your email address is "support@qcislands.net", the above line would read: |
| <INPUT TYPE="hidden" NAME="To" VALUE="support@qcislands.net"> |
| The email sent to you should have a Subject line which describes what it is so that you can easily identify that this particular email came from your webpage form. Let say you would like this email to have a Subject line of "response to web form". Here is the HTML coding for this: |
| <INPUT TYPE="hidden" NAME="Subject" VALUE="response to web form"> |
| And lastly the form program needs to be told where you would like the visitor to go when he/she clicks the "please return to our homepage button". Sometimes this would be your main web page, other times it would be back to a specific page within your site. For this example, we want the person to go back to the main index page for our example user called "me". Here is the HTML coding for me. |
| <INPUT TYPE="hidden" NAME="Home Page URL" VALUE="http://www.qcislands.net/me"> |
| After these specific requirements, you are free to place any
other form fields in your HTML page. Such us for example asking the vistors' name. |
| your name please <INPUT TYPE="text" NAME="name" MAXLENGTH="30"> |
| Or phone number |
| enter phone <INPUT TYPE="text" NAME="phone" MAXLENGTH="12"> |
| Of course the sky's the limit on what you can include in the form, and the creation of all the fields in your form is beyond the scope of this example. |
| Your form should have some type of "submit" form button to let the visitor send the email to you. And perhaps a "clear" button. Here is the example for these two: |
| send me this information<INPUT TYPE="submit"> clear this form <INPUT TYPE="RESET"> |
| And the the final closing FORM command: |
| </FORM> |
| To recap: <FORM ACTION="/cgi-bin/form-mail.cgi" METHOD="POST"> <INPUT TYPE="hidden" NAME="To" VALUE="support@qcislands.net"> <INPUT TYPE="hidden" NAME="Subject" VALUE="response to web form"> <INPUT TYPE="hidden" NAME="Home Page URL" VALUE="http://www.qcislands.net/me"> your name please <INPUT TYPE="text" NAME="name" MAXLENGTH="30"><BR> enter phone <INPUT TYPE="text" NAME="phone" MAXLENGTH="12"><BR> send me this information<INPUT TYPE="submit"> clear this form <INPUT TYPE="RESET"> </FORM> |
| Here is the form which we've just created |
| If one of the
<INPUT TYPE="text">
records you have has a NAME
of "email" _or_
"e-mail", this routine will
attempt to validate the email address supplied so as to prevent
disappointment with an invalid email address. example: |
| your email address
<INPUT TYPE="text" NAME="e-mail"
MAXLENGTH="30"><BR> |
| After the visitor has depressed the submit button, they are greeted with a web page which looks like this: |
|
| We will respond to your email as soon as possible. |
| please return to our homepage |
| You can customize the last two responses if you do not like
our standard messages. The message which begins "We will respond to your email ..." can be referenced as another "hidden" INPUT TYPE with the NAME of "Response". The message "please return to our homepage" can be referenced as a "hidden" INPUT TYPE with the NAME of "Return". Examples: <INPUT TYPE="hidden" NAME="Response" VALUE="We appreciate your comments"> <INPUT TYPE="hidden" NAME="Return" VALUE="please return to our comments page"> If you leave off either of these two hidden fields the visitor will get the default messages as displayed above. IF you do want to use either one of them they must immediately follow the "Home Page URL" hidden INPUT TYPE show above. |
To recap after the above enhancements: <FORM ACTION="/cgi-bin/form-mail.cgi" METHOD="POST"> <INPUT TYPE="hidden" NAME="To" VALUE="support@qcislands.net"> <INPUT TYPE="hidden" NAME="Subject" VALUE="response to web form"> <INPUT TYPE="hidden" NAME="Home Page URL" VALUE="http://www.qcislands.net/me"> <INPUT TYPE="hidden" NAME="Response" VALUE="We appreciate your comments"> <INPUT TYPE="hidden" NAME="Return" VALUE="please return to our comments page"> your name please <INPUT TYPE="text" NAME="name" MAXLENGTH="30"><BR> enter phone <INPUT TYPE="text" NAME="phone" MAXLENGTH="12"><BR> your email address <INPUT TYPE="text" NAME="e-mail" MAXLENGTH="30"><BR> send me this information<INPUT TYPE="submit"> clear this form <INPUT TYPE="RESET"> </FORM> |
| Good Luck! |
|
Home |