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

Disable button based on multiple condition

Hi,

I have Radio button which contains "Y" and "N". When User Clicks "Y" it hides few datacards that are not needed. When User Clicks "N" it displays datacards that are need. The "N" part consist of 1 more radio button say Radio2, which also contains "Y" and "N". When User clicks "Y" it display one datacard let's say DataCard1, when "N" is selected, it display datacard2. Now, I would like to disable buttton if datacard1 or datacard2 is empty. As soon as user enter some data, the button should be enable otherwise it will be in disable mode.

 

I have below code in DisplayMode property of the button, which show button in disable mode when user selects "Y" in Radio2 and no data is entered in datacard1. I am not sure how should I disable the button when Radio2 has "N" selected and no data is entered in datacard2 ?

 

If(Radio1.SelectedText.Value="N" && IsBlank(DataCardValue1.Text),Disabled,Edit)

 

Any help is appreciated.

Thanks in advance for your time!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

@Newbie12 

How about we try the logic the other way instead of when the button is disabled,  Figure out what the conditions must be met before the button can be enabled?  So far, I have data in either of two data cards.   

View solution in original post

6 REPLIES 6
Super User II
Super User II

@Newbie12 

If I understand right, you only want to be able to enable the button if there is data in either textinput box.  

 

If(
    !IsBland(
             DataCardValue1.Text
      ) || !IsBlank(
                     DataCardValue2.Text,Edit,Disabled
            )
)

 

If I have misunderstood and there are other conditions to be met before enabling the button, please let me know.

@Drrickryp 

Correct. However, in the above code, when "Y" is selected from Radio1, button is disabled, Which is suppose to be enabled. So the only time when button shuld be disable is when datacard are empty.

 

Any workaround ?

Thanks in advance,

Super User II
Super User II

Why do you want you want the button enabled if Y is selected, when the datacards aren't visible at that time and would be empty?  It seems to me the only time you want the button enabled is if there is data in one of the datacards.

Correct..."Y" has some dropdowns as well, that needs to be submitted. Sorry for confusion.

 

Thanks,

Super User II
Super User II

@Newbie12 

How about we try the logic the other way instead of when the button is disabled,  Figure out what the conditions must be met before the button can be enabled?  So far, I have data in either of two data cards.   

View solution in original post

Thanks!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (60,162)