Results 1 to 5 of 5

Thread: Need help with conditions rule

  1. #1
    Join Date
    Dec 2005
    Posts
    74

    Default Need help with conditions rule

    I have banged my head against this wall a bit too long; I'd appreciate some help.

    Background: A form has a select field with a list of organizations as options, option values are the organization ids having the field name orgId. There is also a text input for an organization name to be used if the name is not on the list. I have tried the following rule:
    Code:
    @ IF @ npo  @ orgId^organization @@Message displayed@
    and gotten some inconsistent results. (Field npo is present in all tests.)

    In a test I ran I got the results shown in the attached jpg. [Best way I could present results.] Please note that where it shows "Message NOT displayed" it is because formmail rejected the post but without an error message. In no case was the post successful. I'd be most grateful to learn how to get proper results, i.e., message displayed when both or neither are present. Post is successful when one or the other is present.

    Many thanks.

    George
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	rule.JPG 
Views:	75 
Size:	56.9 KB 
ID:	309  

  2. #2
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Need help with conditions rule

    so, ^ is "exclusive-OR", which means the test is true if either is set, but is false if both are set or neither is set

    so, this means:

    • if orgID AND organization are set, fail
    • if orgID is not set AND oraniztion is not set, fail
    • otherwise succeed

    in ur results, that's exactly wot ur getting with orgID=''

    with orgID=0, u have a problem, right?

    i think the problem is this setting: ZERO_IS_EMPTY

    i think u have this set to false, and u need it set to true

    in other words, u want orgID=0 to mean "orgID is empty"

    of course, this will affect testing of *all* numeric fields in ur form, so you need to be careful.

  3. #3
    Join Date
    Dec 2005
    Posts
    74

    Default Re: Need help with conditions rule

    Thanks for taking the time to look at this.

    Question: for orgId = '', why then is the form still rejected by formmail, but without the message? What other source of failure might there be?

    Full disclosure, the tests were run with extracts from the forms now in development in an effort to cut down on noise. It is possible, although unlikely (I hope), that this affects the outcome of posting.

    g

  4. #4
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Need help with conditions rule

    Please note that where it shows "Message NOT displayed" it is because formmail rejected the post but without an error message.
    i didn't read that carefully enuf....

    i don't know....coz...

    formmail *never* rejects a submission without displaying an error message and/or sending an alert.

    so, make sure u have DEF_ALERT set and have tested ur alert messages.

    also, set ALERT_ON_USER_ERROR to true so u can debug wot formmail thinks is wrong with the submission.

  5. #5
    Join Date
    Dec 2005
    Posts
    74

    Default Re: Need help with conditions rule

    Thanks for the pointers.

    I think I had to solve this same problem before, but my gray hair is eating memory cells! I needed to set sendmail_from (again? in a reinstall?) of php.

    Once done all works fine. Good to know formmail will _always_ tell you what's wrong if the problem is with formmail.

    g

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
  •