Perl Mailer v2.0
Instructions:
- Log in and add the desired form to the access database:
- Create your form, adding the following mandatory hidden fields:
- form_name: this is the name of the form assigned in the
access database
- field_list: this is a comma-delimited list of the fields
you want printed in the e-mail, in the specified order
Example:
<input type="hidden" name="form_name" value="MyForm">
<input type="hidden" name="field_list" value="first, last,
company, address, city, state, zip, comments">
- Add the following optional fields:
- subject: the subject line to use in each e-mail
- redirect: the URL of the page to display after a successful
submission.
- validate:*: a list of fields to validate before allowing
submission. The list is a comma-delimited list, and the the asterix
can be one of the following data types:
- e-mail: Checks for a valid e-mail format
(/^[\w\.-][email protected][\w.-]+\.\w{2,3}$/)
- telephone: Checks for a US-style telephone number
with area code
(/^\(?\d{3}\)?[\s\-\.]?\d{3}[\s\-\.]?\d{4}$/)
- zip code: Checks for a US zip code with optional four
digit suffix (/^\d{5}-?\d{4}?$/)
- has text: Checks to see if the field is not empty
- decimal: Checks to see if negative or positive
number was entered (integers will pass this test, too)
(/^[-+]?\d+(\.\d+)?$/)
- integer: Checks for a positive or negative integer
(/^[-+]?\d+$/)
- validateif:*: same as the above, but only validates if a value
was submitted. This allows validation on fields without making them
mandatory for form submission.
Example:
<input type="hidden" name="validate:has text" value="first,
last">
<input type="hidden" name="validateif:zip code" value="zip">
Complete Example:
<FORM method="POST" action="/cgi-bin/mailer/pl">
<input type="hidden" name="form_name" value="MyForm">
<input type="hidden" name="field_list" value="first, last, tel, e-mail,
comments">
<input type="hidden" name="subject" value="Visitor Comments">
<input type="hidden" name="redirect"
value="http://www.mydomain.com/thank_you.html">
<input type="hidden" name="validate:has text" value="first, last">
<input type="hidden" name="validate:e-mail" value="e-mail">
<input type="hidden" name="validateif:telephone" value="tel">
First Name: <input type="text" name="first">
Last Name: <input type="text" name="last">
E-mail: <input type="text" name="e-mail">
Tel.: <input type="text" name="tel">
Comments: <textarea name="comments"></textarea>
<input type="submit">
</form>
© 1999 - 2002 Arthur Corliss,
[email protected]