cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Disable Enable button on dropdown selection

Hello Experts,

 

i want button to be enable or disable on dropdown selection. in dropdown either value will be filled or it will be blank. If dropdown has value button will be enable otherwise disable . so i am writing this on dropdown ONChange property:

 

If(IsBlank(Dropdown9_1.Selected.Result),UpdateContext({var3:true}),UpdateContext({var3:false}))

 

on button DisplayMode:

 

If(var3=true,Disabled,Edit)

 

 But button is always active not following condition , am i making any mistake :? , i tried with ISEmpty function , still same. please advise 

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

I suggest you remove the formula on the OnChange if the objective is to change the display mode based on the drop-down being blank.

 

Then

Change the formula on the display mode of the button to;

If(IsBlank(Dropdown9_1.Selected.Result),DisplayMode.Disabled,DisplayMode.Edit)

 

----------


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

4 REPLIES 4
eka24
Super User
Super User

I suggest you remove the formula on the OnChange if the objective is to change the display mode based on the drop-down being blank.

 

Then

Change the formula on the display mode of the button to;

If(IsBlank(Dropdown9_1.Selected.Result),DisplayMode.Disabled,DisplayMode.Edit)

 

----------


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

View solution in original post

gabibalaban
Super User
Super User

Hi @Anonymous ,

I'm not getting all the context of your app, but please try to put:

If(Len(Dropdown9_1.Selected.Result)>0,UpdateContext({var3:false}),UpdateContext({var3:true}))

 and also you can use:

If(var3,Disabled,Edit)

as var3 is already a bool variable.

 

Hope it helps !

Anonymous
Not applicable

Hello @eka24 ,

 

This is exactly what i want. thank you so much 

Anonymous
Not applicable

Hello @gabibalaban , Thanks for looking into this issue. i simply wanted to restrict user if he did not made any selected in the respected field.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,170)