Drop Shadow

Custom Errors

If you use a tool such as Dreamweaver, you may end up having to put the e-mail include at the top of your page. Displaying errors (such as unfilled required fields) at the top of the page will cause problems with your styles and the layout of your page.

You can tell email.php to not display errors automatically, but to store them up until you’re ready to display them yourself.

  1. Add “$formCustomWarn=true;” to your page before you include email.php.
  2. Where you want the errors to be displayed (sometime after including emaill.php) add “formWarn();”.

Remember to verify that your warnings are appearing as expected. If you’re also using the Javascript warning system, turn Javascript off in your browser to test it. If you don’t display warnings, people filling out the form won’t know why it keeps coming back to them—or even that there’s a problem at all.

Style sheets

Whether you use $formCustomWarn or not, you can change the look of your warnings through style sheets.

  • The form’s warnings will be displayed in a “div” of class “formWarnings”.
  • Each individual warning, if there are more than one, will be displayed in a “div” of class “formWarning”.
  • Some warnings have titles, which will be displayed in an “h2” tag.
  • Warnings about unfilled requied fields will be displayed in “li” items in a “ul” list.