I have a requirement to count the number of "unhidden" controls in a form. Take the example below:
A choice control hides 1 or 2 calculated value controls. I need to display a total for the number of calculated values being displayed. For example:
When one calculated value control is displayed the count should return "1":
When two calculated value controls are displayed the count should return "2":
Is there some kind of JS sorcery that can identify whether a control is hidden or displayed and provide a count? I have attached an export of the form shown in these examples.
wouldn't evaluating your dropdown being easier than counting the hidden/unhidden controls?
Please let us know, if this is not an option for you and why it isn't.
Thanks for responding. That's a good question and an interesting approach.
The example I've provided above is a simplified version of the solution I'm developing. In my actual solution I have a range of 21 calculated value controls that are displayed based on quite a number of formatting rules.
I see. I would start by inspecting the DOM at this point. Open up your form in preview mode and run your browsers developer tools. Try to find your hidden/unhidden controls and see how they are hidden. There should be some flag/property/inline-styling that decides whether your controls are hidden or visible.