cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

Disable a button from a combination of selected controls

Dear PowerApps, 

 

I am having a trouble combining my functions. I can disable a button from a single control but not if I combine all of the following: textinput, checkbox and dropdown. 

Here's the codes that I used so far:

 

Checkbox.PNGDropdown.PNGTextbox.PNG

 

 

 

 

Please help me resolve this issue. 

Thank you in advance,

Kharina

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Disable a button from a combination of selected controls

Hi @kharina ,

Do you want the button be editable when:

1)one or more checkbox is checked;

2)all the textinputs has value;

3)drop down has selected value?

If so, you should set the button's DisplayMode like this:

If(
    (Checkbox1.Value=false && Checkbox1_1.Value=false && Checkbox1_2.Value=false)||
//all checkboxes have not been checked 
    Dropdown3_1.SelectedText.Value="Select"||
//drop down has not selected value
(IsBlank(TextInput1.Text)||IsBlank(TextInput1_1.Text)||IsBlank(TextInput1_2.Text)),
//one of textinput has no value
    DisplayMode.Disabled,
    DisplayMode.Edit)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Highlighted
Memorable Member
Memorable Member

Re: Disable a button from a combination of selected controls

Hi @kharina .

Let me just brief your requirement. correct me if I am wrong.

First Requirement - You need to Enable a button if any checkbox out of 3 is selected. 
See the below Code and Screenshot for reference.

If(Checkbox1.Value=false && Checkbox1_1.Value=false && Checkbox1_2.Value=false,DisplayMode.Disabled,DisplayMode.Edit)

VijayTailor_0-1601274467238.png

 

Second Requirement - 
The button is Display is Enable Mode if Any other option is Selected instead of "Select"

If(Dropdown1.Selected.Item="Copy",DisplayMode.Disabled,DisplayMode.Edit)

VijayTailor_1-1601274588556.png

 

The third Requirement is if any textbox is blank then the button should be disabled.

If(IsBlank(TextInput2.Text) || IsEmpty(TextInput2.Text) || IsBlank(TextInput2_1.Text) || IsEmpty(TextInput2_1.Text) || IsBlank(TextInput2_2.Text) || IsEmpty(TextInput2_2.Text), DisplayMode.Disabled,DisplayMode.Edit)

 

VijayTailor_2-1601274687546.png

 


Thanks,
Hope your issue is resolved.
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper IV
Helper IV

Re: Disable a button from a combination of selected controls

Hello @VijayTailor , 

 

I appreciate your reply. 

I can do those 3 things that you mentioned. 
My problem is with the big button -- I want to combine those 3 things that you mentioned in just 1 button.
I want to show the big button as disabled unless my checkbox, textinput, and dropdowns are completely filled in.

 

Thank You,

KH

Highlighted
Memorable Member
Memorable Member

Re: Disable a button from a combination of selected controls

HI @kharina ,

Please find the Combine code as you need.

If(IsBlank(TextInput2.Text) || IsEmpty(TextInput2.Text) || IsBlank(TextInput2_1.Text) || IsEmpty(TextInput2_1.Text) || IsBlank(TextInput2_2.Text) || IsEmpty(TextInput2_2.Text) && Checkbox1.Value=false && Checkbox1_1.Value=false && Checkbox1_2.Value=false && Dropdown1.Selected.Item="Copy", DisplayMode.Disabled,DisplayMode.Edit)

Now button is Disabled till all the condition fulfill
Thanks,
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Highlighted
Helper IV
Helper IV

Re: Disable a button from a combination of selected controls

Hi @VijayTailor , 

 

I tried it, but it didn't work. The Button will show enabled just when I finished filling in the textinput boxes. 


Can you show me how you made it to work by .gif?

Thank You and Kind Regards,

Kharina

Highlighted
Memorable Member
Memorable Member

Re: Disable a button from a combination of selected controls

Hi @kharina ,

Please just cross-check yous condition with my Test App.

Hope that will help you to resolve your Issue.

Please find attached my App for your reference.

Thanks

Highlighted
Helper IV
Helper IV

Re: Disable a button from a combination of selected controls

Hello @VijayTailor ,

 

Thank you for your great patience. 

I tested from my side, and when I do, even if the "Copy" is selected, the button is already enabled. 

testappcopy.PNG

The first option for my dropdown is "Please Select" . So considering that "Copy" is equivalent to "Please Select", I need to show the button as disabled if "Copy" was initially selected. 

 

Can you help me check this again?

 

Thank you very much,

KH

Highlighted
Memorable Member
Memorable Member

Re: Disable a button from a combination of selected controls

For this requirement, you can use below Workaround.

Add Toggle and Add the default value based on the checkbox value.
Same way add new toggle for the drop-down and set the value based on the condition of the dropdown value.
Same again for text Box,

and in the button Display Mode give condition is Toggle1 & Toggel2 & toggle 3 should be true the DisplayMode is Edit else Disabled
Highlighted
Community Support
Community Support

Re: Disable a button from a combination of selected controls

Hi @kharina ,

Do you want the button be editable when:

1)one or more checkbox is checked;

2)all the textinputs has value;

3)drop down has selected value?

If so, you should set the button's DisplayMode like this:

If(
    (Checkbox1.Value=false && Checkbox1_1.Value=false && Checkbox1_2.Value=false)||
//all checkboxes have not been checked 
    Dropdown3_1.SelectedText.Value="Select"||
//drop down has not selected value
(IsBlank(TextInput1.Text)||IsBlank(TextInput1_1.Text)||IsBlank(TextInput1_2.Text)),
//one of textinput has no value
    DisplayMode.Disabled,
    DisplayMode.Edit)

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper IV
Helper IV

Re: Disable a button from a combination of selected controls

Dear @v-yutliu-msft , 

 

You gave a very big smile on my face today! I'm very happy!!!! Thank you for your solution. I really appreciate it!!! 

Cheers!

Kharina

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (10,379)