+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15

Thread: HTML Template for error handling

  1. #11
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    Can you give me an expample of what you mean by a path instead of a url?

  2. #12
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    OK, I got the path thing figured out: home/bla bla/fm_templates.

    This worked good, no more error messages. Thanks.

    I tried placing the $realname item in the error.htm HTML Template, but it did not receive any values when the error page was generated. Is there a particular syntax to use other than $realname to get this to work?

  3. #13
    Join Date
    Dec 2003
    Posts
    3,900

    Default Re: HTML Template for error handling

    Hi,

    You can't use $realname and $email in the template. This is just a limitation.

    The workaround is to use derived fields:

    Code:
    Your name: <input type="text" name="personsname" />
    <input type="hidden" name="derive_fields" value="realname=personsname" />
    And then use $personsname in the template.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #14
    Join Date
    Jul 2005
    Posts
    28

    Default Re: HTML Template for error handling

    Russell,


    I tried this but still no go, not sure what I am doing wrong here. In the form, I now have this field:

    <input type="hidden" name="derive_fields" value="realname=First_Name + Last_Name,fullname=First_Name + Last_Name">

    My form obviously has separate first and last name fields. In order to get the "realname" reflecting their contents [so that the "from" line in my emails has their name in it] I am assigning it the value of "First_Name + Last_Name". I then define a new field "fullname" and do the same.

    But perhaps the problem is how I am inserting the tag in the error page HTML template. I am currently just adding $fullname and that text shows in the readable text as well. Is this supposed to be enclosed in a tag as well?

  5. #15
    Join Date
    Dec 2003
    Posts
    3,900

    Default Re: HTML Template for error handling

    Hi,

    Sorry, I've given you some incorrect information...

    Templates (HTML or Plain) for sending the email can, obviously, refer to fields on the form using $fieldname.

    A template for good_template can also refer to fields using $fieldname.

    However, templates for displaying errors (bad_template) cannot reference fields this way.

    They have tags to show the error and include sensible error messages (<fmerror />, etc), but they cannot show the value of a field.

    The reason for this is simply that the error might (and typically will) be that the user has failed to enter data into the field you're showing.

    In your case, the displayed template will look a little strange if the user has not entered either their first or last name.

    In your case, you want this in your form:
    Code:
    <input type="hidden" name="required" value="email=email2:Email addresses must match">
    and in the template you want this:
    Code:
    <fmerror />
    <ul>
    <fmerroritemlist />
    </ul>
    This will show the basic error message and a bulleted list of the fields that were not correct.

    Such as:

    The form required some values that you did not seem to provide.
    • Email addresses must match
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Advanced Error Handling
    By russellr in forum HOWTO Guides and Tips
    Replies: 12
    Last Post: 26-Oct-2005, 11:38 PM
  2. html output error and parse errors in php
    By dynamicmedia in forum FormMail Subscription Support
    Replies: 8
    Last Post: 01-Dec-2004, 09:49 PM
  3. Problem with HTML template
    By bmollon in forum FormMail Subscription Support
    Replies: 4
    Last Post: 25-Nov-2004, 11:46 PM
  4. External CSS Formatting of HTML Email Template
    By sebestyen in forum FormMail Subscription Support
    Replies: 2
    Last Post: 14-Oct-2004, 10:30 PM
  5. Error template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-May-2004, 04:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts