So-Called Simple Logic for Showing/Hiding a Section Not Working - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

So-Called Simple Logic for Showing/Hiding a Section Not Working

Last post 01-05-2012 08:14 AM by nkstrou. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-04-2012 04:46 PM

    So-Called Simple Logic for Showing/Hiding a Section Not Working

    Hi there all you InfoPathDevvies out there!

     Maybe I've just had a long day or something, but I need to show and hide a Section when certain things in my InfoPath 2010 Filler form are marked (or not marked) and I just can't get it to work with one of my sections.

    When chkIncMgmt (a checkbox) is set to TRUE and txtSGpName (a text field) starts with either "CSU", "CCHD", or "CSS", I need Section 1 to become visible.  When chkIncMgmt is set to TRUE and txtSGpName starts with anything else, I need Section 2 to become visible.  Both Section 1 and Section 2 are set to "Include the section in the form by default".  My rule for txtSGpName starting with anything else and turning on Section 2 works - but my rule for turning on Section 1 when txtSGpName starts with "CSU", "CCHD", or "CSS" does not.

    My Formatting rule is defined to run when the following is true:

    chkIncMgmt is not equal to TRUE AND

    txtSGpName does not begin with "CSU" OR

    txtSGpName does not begin with "CCHD" OR

     txtSGpName does not begin with "CSS"

    The requested action is to hide the control (Section 1).

     

    To no avail, I've tried the nesting trick where I turn off the bottom 2 txtSGpName options and substitute the following for the "does not begin with 'CSU'" line:

    The expression    not(starts-with(../my:txtSGpName, "CSU")) OR not(starts-with(../my:txtSGpName, "CCHD")) OR not(starts-with(../my:txtSGpName, "CSS"))

    With all the backward thinking you have to do in specifying when to hide a control, have I got something backwards?  Or does anyone have any other ideas?

    Many thanks, all!

    nkstrou

     

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
  • 01-04-2012 05:38 PM In reply to

    Re: So-Called Simple Logic for Showing/Hiding a Section Not Working

    Hi there,

    I tried out your scenario real quick and think I got it to work.  You'll need to do your nesting trick with the "begins with" checks in the same expression and the operators need to be "and" instead of "or".  The other part that you'll need to fix is that the first operator needs to be an OR.

    So your rule should look something like this:

    • chkIncMgmt is not equal to TRUE OR
    • The expression not(starts-with(../my:txtSGpName, "CSU")) and not(starts-with(../my:txtSGpName, "CCHD")) and not(starts-with(../my:txtSGpName, "CSS"))
    • The requested action is to hide the control (Section 1).

    Hope that works for you!

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 01-05-2012 08:14 AM In reply to

    Re: So-Called Simple Logic for Showing/Hiding a Section Not Working

    Thanks, Anson - that did the trick.  You rock!  :)

     -nkstrou

    An imprecisely defined requirement has an infinite number of possible solutions. Unfortunately, only about a maxiumum of 3 solutions are actually satisfactory to the end user.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.