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

Button disabled if a (OnSelect) function is activated

Hey guys, 

 

Ill try to make this as simple as possible

I have a submit button that is disabled until some text is entered somewhere else on the app. That works fine.  I also need a trigger function for the same button so that if a text label is selected (OnSelect) it creates a pop up text box that until it has some text entered will also lock the same submit button. 

 

Any help would be great, but the less technical the better! "im still a noob" Smiley Frustrated

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: Button disabled if a (OnSelect) function is activated

Hey Courtney,

 

From reading your message I think you are looking for something like this when a user clicks on the trigger text:

TriggerTextDemo.PNG

 

where the text input has been revealed and disables the button until it is populated. To achieve this I added 2 formulas, one to the OnSelect property of the label ("Trigger Label") and one to the DisplayMode property on the button as well as tweeking the visability value of the TextInput.

 

On the Label I put the following formula:

 

UpdateContext({_showPopUpBox:true})

 

which sets a local variable "_showPopUpBox" to true. This is the value I used for the visibility field for the TextInput control.

 

I then added the following formula to the Button:

 

If(_showPopUpBox And IsBlank(TextInput1.Text),Disabled,Edit)

 

which checks if the TextInput field has been revealed and if it has and there is no text in it set the Button to be disabled. Remember to ensure that the default value of the TextInput has been cleared in the control's settings.

 

On other thing I might add would be

Reset(TextInput1)

on the trigger label OnSelect property before the UpdateContext. This would clear the text box before revealing it.

 

Hopefully that is what you were trying to do Smiley Very Happy

View solution in original post

4 REPLIES 4
Highlighted
Advocate III
Advocate III

Re: Button disabled if a (OnSelect) function is activated

Could you provide some screenshots so that I can better understand what you need and help you further 🙂

 

Highlighted
Resolver I
Resolver I

Re: Button disabled if a (OnSelect) function is activated

Hey Courtney,

 

From reading your message I think you are looking for something like this when a user clicks on the trigger text:

TriggerTextDemo.PNG

 

where the text input has been revealed and disables the button until it is populated. To achieve this I added 2 formulas, one to the OnSelect property of the label ("Trigger Label") and one to the DisplayMode property on the button as well as tweeking the visability value of the TextInput.

 

On the Label I put the following formula:

 

UpdateContext({_showPopUpBox:true})

 

which sets a local variable "_showPopUpBox" to true. This is the value I used for the visibility field for the TextInput control.

 

I then added the following formula to the Button:

 

If(_showPopUpBox And IsBlank(TextInput1.Text),Disabled,Edit)

 

which checks if the TextInput field has been revealed and if it has and there is no text in it set the Button to be disabled. Remember to ensure that the default value of the TextInput has been cleared in the control's settings.

 

On other thing I might add would be

Reset(TextInput1)

on the trigger label OnSelect property before the UpdateContext. This would clear the text box before revealing it.

 

Hopefully that is what you were trying to do Smiley Very Happy

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Button disabled if a (OnSelect) function is activated

Welcome to the community @Courtney ! Can you review the above replies and update the thread if they were helpful? 

 

Thank you,

 

@Anonymous 

Highlighted
Helper V
Helper V

Re: Button disabled if a (OnSelect) function is activated

Perfect, thank you!

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 (7,272)