Hey guys
Just as the title says, I'm trying to set Enabled or Disabled some buttons and labels according to the users selection on a Dropdown / List. I tried to set the Buttons/Labels to disabled if the SelectedItem.Value of the list is equal to a "string", set OnChange, but it seems I'm not doing it right, I also tried OnSelect. Any tip will be helpful
If I'm not clear enough please ask
Thank You
Solved! Go to Solution.
Hi @Anonymous,
A good way to do this is to create a context variable when some action is true. The action would be in the OnChange property of the Dropdown control. Set the OnChange to If(Dropdown1.Selected.Value="yourvalue", UpdateContext({var:true}),UpdateContext({var:false})). Then set the Button's DisplayMode property to If(var,Edit,Disabled). Similarly, you can use the context variable "var" to hide or show labels and textboxes by setting the Visible property to var.
Hi @Anonymous,
A good way to do this is to create a context variable when some action is true. The action would be in the OnChange property of the Dropdown control. Set the OnChange to If(Dropdown1.Selected.Value="yourvalue", UpdateContext({var:true}),UpdateContext({var:false})). Then set the Button's DisplayMode property to If(var,Edit,Disabled). Similarly, you can use the context variable "var" to hide or show labels and textboxes by setting the Visible property to var.
@Anonymous @Drrickryp
The easiest thing to do is to go to the button's display mode and set that with the condition like this
No need to use a context variable!!
If(is_vaccinated_dropdown_input.SelectedText.Value = "No", DisplayMode.Disabled, DisplayMode.Edit);
User | Count |
---|---|
160 | |
84 | |
70 | |
64 | |
60 |
User | Count |
---|---|
205 | |
146 | |
95 | |
84 | |
66 |