Haven’t found this in the forums but what I want to do should be pretty simple. I have checkboxes in a Repeating Group. When at least one of them are checked, I want to hide an input element. When all checboxes are unchecked, I want the element to be visible. After a good deal of experimenting, I’ve been able to use states to get the element to be invisible when checked but not the other way around.
Appreciate the help.
Hi there, @max.black761… I did a quick test and this condition on the input field appears to achieve the desired behavior…
Want to give that a shot and see if it gets you what you need?
Sorry I forgot to mention that the input is outside of the Repeating Group. So the checkbox isn’t available as a selection in the “When” box. That’s one of the reasons I tried to set states.
There are probably multiple ways, but here’s one using a custom state along with a conditional (as @mikeloc suggested)…
The basic idea is to use a custom state to keep track of the number of checkboxes that are checked, and then use a conditional on the input to show/hide based on the custom state.
Here’s a link to editor.
EDIT: Oh yeah, forgot to mention that there’s a workflow on the checkbox’s input has changed event. That’s where the value of the custom state is set.
Beautiful. That works great. Now if I can just add one more complication. What if the input I’m looking to hide or show is in a pop up in a reusable header and not on the page with the checkboxes and repeating group?
If I recall correctly, custom states defined on a reusable element are accessible from any page containing the reusable element.
I forgot to mention My Fed Loan that the input is outside of the Repeating Group. So the checkbox isn’t available as a selection in the “When” box. That’s one of the reasons I tried to set states.