Hide control when two yes/no boxes are checked - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » Hide control when two yes/no boxes are checked Hide control when two yes/no boxes are checked Last post 10-21-2019 04:13 PM by buddeh. 15 replies. Page 1 of 2 (16 items) 1 2 Next > Sort Posts: Oldest to newest Newest to oldest Previous Next 10-18-2019 09:35 AM buddeh Joined on 08-01-2019 Posts 8 Hide control when two yes/no boxes are checked Reply Contact I'm creating a "Priority Matrix" for a form, and I am using Buttons that say "X" to update the table (I don't know how to describe this in words). Basically, I need the button to appear when the "Priority: High" yes/no checkbox is checked AND "Urgency: Emergency" yes/no checkbox are checked, but when I set the rule like this the button appears the second I click the "Priority: High" yes/no checkbox. I'm sure I'm missing something simple here. If it's not possible to do it this way, do you have any ideas for how to approach this? 10-18-2019 09:43 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Any chance I can see your form? You can attach it under the options tab in a reply - this should just be a matter of having two conditions on your formatting rule.... so I'm wondering if there is a difference between the defaults for your Urgency checkbox.... One way I debug these things is by separating out the conditions and then instead of hiding the button, changing its color. That way I can see what condition is impacting the control - does that make sense? Hilary Stoupa 10-18-2019 09:59 AM In reply to buddeh Joined on 08-01-2019 Posts 8 Re: Hide control when two yes/no boxes are checked image.PNG Mark as Not AnswerMark as Answer... Reply Contact I can't upload the form, but the rules I have set look like this: High Impact checkbox: Rule: Low if Impact_High = TRUE or Impact_High = "1", set Impact_Low to FALSE Rule: Medium if Impact_High = TRUE or Impact_High = "1", set Impact_Medium to FALSE Emergency Urgency checkbox: Rule: Low if Urgency_Emergency = TRUE or Urgency_Emergency= "1", set Urgency_Low to FALSE Rule: Medium if Urgency_Emergency = TRUE or Urgency_Emergency= "1", set Urgency_Medium to FALSE Rule: High if Urgency_Emergency = TRUE or Urgency_Emergency= "1", set Urgency_High to FALSE Rule on the button I want to disappear (image of form attached): Rule: EH if Urgency_Emergency != TRUE AND Impact_High != TRUE, Hide this control where != means does not equal Basically what I want is for that button with the X in the Priority matrix to show up when both High impact and Emergency are selected. Ideally, I'd have buttons in each of those table spaces with similar rules. 10-18-2019 10:01 AM In reply to buddeh Joined on 08-01-2019 Posts 8 Re: Hide control when two yes/no boxes are checked Capture.PNG Mark as Not AnswerMark as Answer... Reply Contact Rules in a more readable format: 10-18-2019 02:31 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Thanks for the explanation - I'll try to put together a sample later today. Hilary Stoupa 10-18-2019 02:34 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Actually, I have a question - why use checkboxes for this? Wouldn't radio buttons be easier to deal with, since only one option for each category should be selected? Hilary Stoupa 10-18-2019 03:27 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Sample.xsn Mark as Not AnswerMark as Answer... Reply Contact Ok. So looking at your formatting rule - you need to be using OR instead of AND there - I got it backwards on my sample form at first, too. Save the attached form locally, right click and select Design, then preview. I didn't add all the buttons, just enough to show the logic. And I used radio buttons because I didn't want to have to add a ton of rules to clear checkboxes if other checkboxes are selected. By the way - as to the post formatting, if you post in IE, you won't have your line breaks removed. The forum software is ancient and doesn't work well in modern browsers. Hilary Stoupa 10-18-2019 03:51 PM In reply to buddeh Joined on 08-01-2019 Posts 8 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact That all makes perfect sense. You are a life saver! I think I chose to use the checkboxes because of my formatting, but mostly I think I just forgot that radio buttons are a feature... Not sure how to recover from that one haha. This is probably a dumb question, but... Why is it an OR instead of an AND? 10-18-2019 04:26 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact It isn't a dumb question at all, and I really struggle with it. It has to do with the != aspect of things. If we were deciding when to show the control - we'd say "Show the control if this is Low and that is Low" and it would make sense. But when we are hiding, and we have negatives, we are saying "Don't show the control if this is NOT Low OR if that is NOT Low". But basically - I always pick the wrong one the first time around, preview, see it is wrong and switch. I think there is some math-y way of explaining this, but I am not a math-y person. :-) Hilary Stoupa 10-18-2019 04:28 PM In reply to buddeh Joined on 08-01-2019 Posts 8 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Thank you so much you've been incredibly helpful. I have everything working perfectly now. Darn Math... 10-21-2019 07:38 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Wonderful, glad I could help. Darn math indeed - it something I struggle with too. :) Hilary Stoupa 10-21-2019 12:59 PM In reply to buddeh Joined on 08-01-2019 Posts 8 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Okay, so I have everything working much better, but all of a sudden I'm having an issue where the rules we created above are not executing on all views. The X's are showing up as expected on the "default" view, but not on my "section 1" view, if that makes sense. Basically, my default view shows all 5 sections of the form for reviewing purposes, and then I have the sections spread out across different views called Section_1, Section_2, etc. For whatever reason the default view is showing the x's checked correctly, but not the Section_1 view. 10-21-2019 01:40 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact Have you verified the formatting rules are correct on the buttons in the other views? Hilary Stoupa 10-21-2019 02:10 PM In reply to buddeh Joined on 08-01-2019 Posts 8 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact The rules are the same in both views, and I even deleted the button and re-wrote the rule exactly how it's appearing on the default page and nothing... It is still updating on the default page though. 10-21-2019 02:15 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Hide control when two yes/no boxes are checked Mark as Not AnswerMark as Answer... Reply Contact So my guess would then be that the controls on the non-working view (the radio buttons or checkboxes or whatever) are bound to different fields than the working view. I.e., the radio buttons on view 1 are bound to field1 and field2, and the button conditional formatting uses field1 and field2. In view 2 the radio buttons are bound to field3 and field4, but the buttons are still using field1 and field2. Or, perhaps the values for selection are different and the rules are using the wrong values. In the view that doesn't work, you can always try changing the button color instead of hiding, that may help you track it down. Hilary Stoupa Page 1 of 2 (16 items) 1 2 Next > Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
That all makes perfect sense. You are a life saver!
I think I chose to use the checkboxes because of my formatting, but mostly I think I just forgot that radio buttons are a feature... Not sure how to recover from that one haha.
This is probably a dumb question, but... Why is it an OR instead of an AND?