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

Buttons reset back to default when clicked

Hi, Im trying to disable the approve/reject button when the textbox is blank.

 

I have set the displaymode for the button as If(IsBlank(TextInput1.Text),Disabled,Edit). it seems to initially work fine.

 

however, once i populate the textbox and approve/reject (botton click), all other buttons get active (reset back to normal) even though the text box is blank.

Ill appreciate any insight in solving this

 

damiosiks_1-1656079538842.png

damiosiks_2-1656081123841.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @damiosiks ,

 

Could you please share more details about your scenario? Why are you using 2 Patch function to update same item in same data source?

 

Please modify the OnSelect of the buttons, combine the two patch function together and:

1. set the Default property of the TextInput1 to ThisItem.PM_Comments

2. DisplayMode of the two buttons:

If(TextInput1.Text = ThisItem.PM_Comments || IsBlank(ThisItem.PM_Comments), DisplayMode.Disabled, DisplayMode.Edit)

so when no modification on the text input box or it's blank, buttons will be disabled.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

4 REPLIES 4
AhmedSalih
Solution Sage
Solution Sage

@damiosiks , Add Reset(TextInput1) to the end of your OnSelect property formula. Make sure the the Default Property value of TextInput1 is set to ""

 

 

Regards,
Ahmed
If my reply helped you, please give a 👍. And if it has solved your issue, please consider Accept it as the Solution to help other members in the community find it more.

Hi @AhmedSalih , it still doesnt work

@damiosiks, Well, I have tested on a similar design and it is working just fine for me.  Whenever I type in any of those TextInput in this gallery, The button will be in an edit mode, and once clicked, the reset function reset the TextInput to the default with is Blank and button will be grayed out. 

 

AhmedSalih_0-1656100724630.pngAhmedSalih_1-1656100755018.png

 

 

Hi @damiosiks ,

 

Could you please share more details about your scenario? Why are you using 2 Patch function to update same item in same data source?

 

Please modify the OnSelect of the buttons, combine the two patch function together and:

1. set the Default property of the TextInput1 to ThisItem.PM_Comments

2. DisplayMode of the two buttons:

If(TextInput1.Text = ThisItem.PM_Comments || IsBlank(ThisItem.PM_Comments), DisplayMode.Disabled, DisplayMode.Edit)

so when no modification on the text input box or it's blank, buttons will be disabled.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,422)