Results 1 to 4 of 4

Thread: using conditions, I see only the first failure

  1. #1
    Join Date
    May 2007
    Posts
    11

    Default using conditions, I see only the first failure

    I am writing a form that is intended to provide information to AANE (Asperger's Association of New England) about all kinds of community resources. I am so impressed with this program! I have my entire form working including good and bad templates, and the template that formats the output email to our db administrator. I do have one question (I think this is is the only one left...)

    Using required fields, I get a list of all missing fields. When I use multiple condition statements, however, I get only the first error field.

    Both error conditions are working, because when I make only one error, I get output from whichever one is incorrect (e.g. if I do not put in a valid email address, but I do put in name, I get a correct message that I need a valid email address; conversely, if I put in a correct email address, but do not put in the name, I get a correct message that the name field is blank).

    Does formmail provide just the first error, or am I doing something wrong? I

    Normally, I would use 'required' because it is simple and works well, but I do like the field validation that I found in the forums (it's not quite right, hyphen is also a legal character and I'll post that as a reply) so that I can (sort of) validate the email address. Of course that does not stop someone from putting in micky.mouse@disney.com, but I'm assuming that my users are not intentionally trying to be funny.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: using conditions, I see only the first failure

    Hi,

    All conditions failures are shown at one time.

    However, required is performed before conditions and failures in required stop conditions from being checked.

    So, use required OR conditions, but not both.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    May 2007
    Posts
    11

    Default Re: using conditions, I see only the first failure

    I'm only using conditions, not required. I have conditions1 and conditions2. If there are errors in both conditions statements, only the errors in conditions1 are reported. If there are errors in conditions2 but not in conditions1, then the conditions2 errors are reported.

    I would thus assume that the conditions statements alone are formatted correctly, but that there's some setting or other that says not to stop evaluating conditions statements if you find an error in the first one.

  4. #4
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: using conditions, I see only the first failure

    Hi,

    Your reasoning is correct. And I think I was a little misleading in my earlier answer.

    If you have, say, 5 tests in "conditions1", all errors in those 5 tests will be shown at one time.

    But, "conditions2" is not evaluated if "conditions1" reports errors.

    This is by design, because it allows later "conditions" fields to rely on the success of earlier "conditions" fields.

    So, what you want to do is to merge your "conditions2" tests into "conditions1".
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Conditions for a valid email address
    By bwv in forum FormMail Subscription Support
    Replies: 5
    Last Post: 04-Jul-2005, 08:24 PM
  2. Conditions: Can we use PHP predefined regex?
    By railer in forum FormMail Subscription Support
    Replies: 2
    Last Post: 14-May-2005, 04:06 PM
  3. Sample Conditions Code
    By railer in forum FormMail Subscription Support
    Replies: 1
    Last Post: 14-May-2005, 04:01 PM
  4. help with conditions
    By brian in forum FormMail Subscription Support
    Replies: 19
    Last Post: 12-Mar-2005, 07:52 PM
  5. Help with mail_options and conditions
    By wufpack00 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 06-Jul-2004, 12:49 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
  •