Results 1 to 6 of 6

Thread: Multiple conditions aren't

  1. #1
    Join Date
    Dec 2005
    Posts
    74

    Default Multiple conditions aren't

    I've been running formmail for quite some time, using both required & conditions hidden fields. Yup, I realize it's not on the recommended list. Today I decided to try adding more conditions, but without success.

    I added
    Code:
    <input type="hidden" name="conditions" value=":@condition1:condition2">
    and neither condition was applied. I even tried
    Code:
    <input type="hidden" name="conditions" value=":@condition1">
    and that didn't even apply condition1!

    This behavior obtains whether the specs are in hidden fields or in an INI file.

    So I guess I'm missing something. But what?

    TIA for your help.

    g

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

    Default Re: Multiple conditions aren't

    if u already have a field called "conditions" in ur form, u cannot add another one with that name

    so, if u want multiple "conditions" fields (each may have multiple conditions), then name them like this:
    conditions1
    conditions2
    conditions3
    ...

  3. #3
    Join Date
    Dec 2005
    Posts
    74

    Default Re: Multiple conditions aren't

    So, where it says
    The list of conditions is separated by a character you specify by the first character in the list. You specify the internal conditions component separator as the second character in the list, as follows:
    <input type="hidden" name="conditions"
    value=":@condition1:condition2:condition3" />
    here, one should interpret this as saying one should have either one conditions field or a set of condition{i}, where i is an integer? I took the reference to mean the conditions field was required to capture the set of separate condition fields.

    So with this new understanding, plus some extra work on syntax, I've gotten them all to work.

    Thanks.

    g
    Last edited by GeoBrooks; 25-Oct-2010 at 11:42 PM. Reason: getting smarter!

  4. #4
    Join Date
    Dec 2005
    Posts
    74

    Default Spoke too soon

    I've gone round and round with this and am going gaga. I saw Russell's post about putting them all together in a single condition, so I tried and failed with this:
    Code:
    <input type="hidden" name="conditions" value="
    :@@IF@orgId=0@organization&name&first_name$last_name&email@@Required: an organization, an opportunity name, as well as a contact person with email address.@
    :@@IF@orgId>0@organization@@Please either select an organization or enter a name.  Forms having both are not accepted.@
    :@@IF@orgId>0@!organization@@&name&first_name$last_name&email@@Please specify an opportunity name as well as a contact person with email address.@
    :@@IF@expire_date~((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$))@@Date must be valid in the format mm/dd/yyyy, e.g., 07/04/2010.@
    :@@IF@age~([1-9]|[1-9][0-9])@@Please enter a valid age@">
    How nuts am I?

    Conditions in English:
    There cannot be both an orgId (from a dropdown box) and an organization from a text input.

    With one or the other, there must also be an opportunity name, a first name, a last name and an email address.

    A minimum age must be specified and a valid mm/dd/yyyy expiration date.

    I'm not seeing any of the messages and some conditions are not being tested.

    ARRGGHH!
    g

  5. #5
    Join Date
    Dec 2005
    Posts
    74

    Default What works!

    An ini file containing the following:
    Code:
    [special_fields]
    conditions = ":@
    @ IF @ npo  @ orgId#>0 @ organization @ Please either select an organization or enter a name.  Forms having both or neither are not accepted. @:
    @ IF @ npo  @ orgId ^ organization @@ Please either select an organization or enter a name.  Forms having both or neither are not accepted. @:
    @ IF @ npo  @ name @@ Opportunity name is required@:
    @ IF @ npo  @ realname @@ Contact's first and last names are required@:
    @ IF @ npo  @ email @@ Contact's email address is required@:
    @ IF @ npo  @ age~([1-9]|[1-9][0-9]) @@ Please enter a valid age @ :
    @ IF @ npo  @ expire_date~((^(10|12|0?[13578])([/])(3[01]|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(11|0?[469])([/])(30|[12][0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(2[0-8]|1[0-9]|0?[1-9])([/])((1[8-9]\d{2})|([2-9]\d{3}))$)|(^(0?2)([/])(29)([/])([2468][048]00)$)|(^(0?2)([/])(29)([/])([3579][26]00)$)|(^(0?2)([/])(29)([/])([1][89][0][48])$)|(^(0?2)([/])(29)([/])([2-9][0-9][0][48])$)|(^(0?2)([/])(29)([/])([1][89][2468][048])$)|(^(0?2)([/])(29)([/])([2-9][0-9][2468][048])$)|(^(0?2)([/])(29)([/])([1][89][13579][26])$)|(^(0?2)([/])(29)([/])([2-9][0-9][13579][26])$)) @@ Date must be valid in the format mm/dd/yyyy, e.g., 07/04/2010. @:
    @ IF @ vol  @ realname @@ Your first and last names are required@:
    @ IF @ vol  @ email @@ Your email address is required@
    "
    where npo and vol are fields present to differentiate forms.

    Synapses finally conquered syntax.

    g

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

    Default Re: Spoke too soon

    Quote Originally Posted by GeoBrooks View Post
    I've gone round and round with this and am going gaga. I saw Russell's post about putting them all together in a single condition, so I tried and failed with this:
    Code:
    <input type="hidden" name="conditions" value="
    :@@IF@orgId=0@organization&name&first_name$last_name&email@@Required: an organization, an opportunity name, as well as a contact person with email address.@
    well done sorting it out.

    the problem above is that u said the separator is ":" and then u put ":" inside the message (after "Required")

    that really screws it up.

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. help with conditions
    By brian in forum FormMail Subscription Support
    Replies: 19
    Last Post: 12-Mar-2005, 07:52 PM
  3. Uploading Multiple Images
    By JNewb in forum FormMail Subscription Support
    Replies: 2
    Last Post: 12-Dec-2004, 02:39 PM
  4. Help with mail_options and conditions
    By wufpack00 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 06-Jul-2004, 12:49 AM
  5. Multiple selection list
    By GrandpaRob73 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 25-Jun-2004, 12:45 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
  •