AndrewSymcox
Scholar

Hide Controls Based based on Choice

Jump to solution

Hi All, Hopefully a simple one for the experts (I am new in town). I have a form with a choice drop down. I have a hidden panel which appears if a certain choice is selected i.e. if contains "X". What i cannot achieve is making it appear if contains "X" or "Y"? Any ideas guys? Thanks, Andy.

Labels: (1)
0 Kudos
Reply
4 Replies
allan
Contributor

Re: Hide Controls Based based on Choice

Jump to solution

You want to make make it appear if
MyChoice == 'X' || MyChoice =='Y' 

So you need to hide it when : 
not(MyChoice == 'X' || MyChoice =='Y' )
which is equal to :
MyChoice != 'X' && MyChoice !='Y' 

|| means "or" and && means "and"

Reply
AndrewSymcox
Scholar

Re: Hide Controls Based based on Choice

Jump to solution
Hi Allan,
Thanks for the reply. I really am a novice at this.
At present the below "almost" works, panel appears when 'Unclassified' is selected. I also need said panel to appear if 'Private' is selected.
!contains(Classification,"Unclassified")
0 Kudos
Reply
allan
Contributor

Re: Hide Controls Based based on Choice

Jump to solution

Let's think it that way : In which case do you want to panel to appear ?
When creating a rule, you specify when to hide controls. Hiding is just the opposite of displaying.

You want your panel to be displayed when Classification=='Unclassified' or when Classification=='Private'
--> 

 

Classification=='Unclassified' || Classification=='Private'

 


So the opposite of that is : 

 

NOT(Classification=='Unclassified' || Classification=='Private')

 


That would be your rule.
Do not forget your "empty" case. What should happen if nothing is selected ?
So I suspect your rule would be 

 

NOT(Classification=='Unclassified' || Classification=='Private') || isNullOrEmpty(Classification)

 

0 Kudos
Reply
AndrewSymcox
Scholar

Re: Hide Controls Based based on Choice

Jump to solution
Thanks so much Allan, that's nailed it.
Reply