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.
- Add “$formCustomWarn=true;” to your page before you include email.php.
- Where you want the errors to be displayed (sometime after including emaill.php) add “formWarn();”.
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.