InfoPath 2007 Submit button Conditional Formatting issue - InfoPath Dev
in

InfoPath Dev

InfoPath 2007 Submit button Conditional Formatting issue

Last post 03-02-2016 10:05 AM by Wheels. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 03-01-2016 07:43 AM

    InfoPath 2007 Submit button Conditional Formatting issue

    Good morning / afternoon. I am trying to accomplish the following:

    I have a combobox which has United States and Canada. If the United States is selected then the US section appears, and vice versa for CA. This works fine, but what I have set up on the submit button is the conditional validation which disables the Submit button if an of the required fields are missing. For example:

     If this condition is true: Country is equal to "United Stated" and USAddress1 is blank or USAddressCity is blank or USAddressState is blank or USAddressZip is blank - Disable this control (same for Canada, but with CA references). The Submit button stays disabled unless I complete all the required fields in both sections. It is acting like everything is an 'or' and it does not matter what Country is selected.

    Any suggestions, thoughts, ideas? Am I misunderstanding how the 'and's and 'or's are supposed to operate? 

    WHEELS 

     

    Filed under:
  • 03-02-2016 07:41 AM In reply to

    Re: InfoPath 2007 Submit button Conditional Formatting issue

    Yah - you'll want to group all those or's up. :) So - for each one of the or conditions, change the first box to the dropdown "the expression" - this will give you the XPath that is the expression for the condition. Copy all those out into a text editor. Put parenthesis around them (one at the beginning of the first expression, and one and the end of the last one) and type in "or" between them. Then in your conditions, paste this big new expression in right after your Country = United States condition and delete the rest of them (except this big "or" you created yourself). So - your conditions will have the County = United States and The Expression (my:USAdress1 = "" or my:USAddressState = "" or my:USAdressZip = "") - does that make sense (it sounds more complicated than it is, I'm not explaining things well this morning - attach your form to a reply if you want a hand).
    Hilary Stoupa

  • 03-02-2016 08:14 AM In reply to

    Re: InfoPath 2007 Submit button Conditional Formatting issue

     Hi Hilary. It does make sense. I sometimes forget about the Expression boxes. I'll give it a shot, and let you know. WHEELS

  • 03-02-2016 08:35 AM In reply to

    Re: InfoPath 2007 Submit button Conditional Formatting issue

     Hi Hilary. In the Conditional Formatting of the Submit button (trying to disable), I have the following:

     If this condition is true:

    Country is equal to "United States" and

    The expression my:USAdress1 = "" or my:USAddressCity or my:USAddressState = "" or my:USAdressZip = ""

    Disable this control. 

    Under Conditions with Formatting, it is listed as: Country = "United States" and my:USAdress1 = "" or my:USAddressCity or my:USAddressState = "" or my:USAdressZip = ""

    When I add the parenthesis, it removes them. So basically the Submit button stays enabled. I believe this will not evaluate the expression correctly without the parenthesis.

    Also do I need to use the full XPaths (e.g. /my:myFields/my:USContactInformation/my:USAddress1)? 

    WHEELS 

  • 03-02-2016 08:53 AM In reply to

    Re: InfoPath 2007 Submit button Conditional Formatting issue

    UPDATE: I was able get it to work by entering the full XPath. I added the expression for both United States and Canada. Thank you Hilary. WHEELS

  • 03-02-2016 10:00 AM In reply to

    Re: InfoPath 2007 Submit button Conditional Formatting issue

    Awesome - great job!
    Hilary Stoupa

  • 03-02-2016 10:05 AM In reply to

    Re: InfoPath 2007 Submit button Conditional Formatting issue

     Thanks Hilary. Not bad for a noob, huh?

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.