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

How to disable textbox and button after click submission using control in Gallery

Dear team,

 

I have tried to disable textbox and submit button after user first click submission. I want to get this function to prevent submit the request multiple times. 

 

Could anyone assist how could we produce that result? 


Thanks,

Phearin

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @phearin ,

Do you mean that:
1)if you click the submit button, the textinput and the submit button will be disabled?

2)if you click the enable button, the textinput and the submit button will be enabled?

If so, you just need to insert an enable button inside the gallery and remove the selected item when you click the enable button.

For example:

1)submit button's OnSelect:

Collect(colSubmittedRows, {Name: ThisItem.Name});

2)enable button's OnSelect:

Remove(colSubmittedRows,LookUp(colSubmittedRows,Name=ThisItem.Name))

3)set the textinput and the submit button's DisplayMode:

If(ThisItem.Name in colSubmittedRows.Name, DisplayMode.Disabled, DisplayMode.Edit)

7284.PNG

 

 

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

10 REPLIES 10
mdevaney
Super User
Super User

@phearin 
If you can show the full gallery with some fake data in it I might have a few ideas.  Otherwise, its pretty hard to understand how your app currently works.  I need to see all of the data columns.


Please send another screenshot.

 

---
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."

@mdevaney 

This gallery below information, I have textbox and submit button.

My idea is that when user hit submit button then I want to change textbox and submit button to disabled mode where user couldn't have option to resubmit it again or change any values.

 

2020-07-27 09_51_24-Window.png

 

Thanks,

Phearin

@phearin 
I will assume the column 'Name' is unique and no values repeat within it.

 

Put this code in the OnSelect property of your submit button:

Collect(colSubmittedRows, {Name: ThisItem.Name});

// the rest of your code to submit the row goes here

 

Then put this code in the DisplayMode property of the button

If(ThisItem.Name in colSubmittedRows.Name, DisplayMode.Disabled, DisplayMode.Edit)

 

The idea here is any Names found inside colSubmittedRows will cause the button to become disabled.

 

---
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."

 

@mdevaney 

 

Thank for your quick update. Now, the button has been disabled.

However, is there anyway that can be enable the button with some trigger conditions, so that user can resubmit the request without create new row in SP list? 

 

Thanks,

Phearin 

@phearin 
I don't know.  Since I have answered your original question please Accept As Solution and start a new thread to ask your follow-up question.  Some one else can hopefully assist.

 

---
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."

@mdevaney 

 

Thank for your feedback. 

As your solution, it works only for button while textbox was not disabled. Could you advise more? 


Thanks,

Phearin

@phearin 

I don't understand your response.  Maybe it would be better to show me with pictures.

@mdevaney 

 

Please find below picture. 

After click on submit button, both submit && textbox will be disable. and also we want to keep enhancement on when we don't have fill the textbox then submit button will not trigger. 

 

Thanks,

Phearin

 

2020-07-28 09_53_28-Let's Talk & 360 Feedback - Saved (Unpublished) - Power Apps.png

Hi @phearin ,

Do you mean that:
1)if you click the submit button, the textinput and the submit button will be disabled?

2)if you click the enable button, the textinput and the submit button will be enabled?

If so, you just need to insert an enable button inside the gallery and remove the selected item when you click the enable button.

For example:

1)submit button's OnSelect:

Collect(colSubmittedRows, {Name: ThisItem.Name});

2)enable button's OnSelect:

Remove(colSubmittedRows,LookUp(colSubmittedRows,Name=ThisItem.Name))

3)set the textinput and the submit button's DisplayMode:

If(ThisItem.Name in colSubmittedRows.Name, DisplayMode.Disabled, DisplayMode.Edit)

7284.PNG

 

 

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.

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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,246)