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.

gabibalaban
Dual Super User
Dual 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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PWREduCon768x460.png

Join us at PWR EduCon - A Power Platform Conference

Learn from the top Power BI, Power Apps, Power Automate & Power Virtual Agents experts!

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