# Can the Submit Button be made to wait until all uploads are complete?

**URL:** <https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666>\
**Category:** Ask for Help\
**Created:** [August 15, 2024, 4:17pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666 "2024-08-15T16:17:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kellar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kellar/32/69515_2.png) [@Kellar](https://community.glideapps.com/u/Kellar)\
**Post date:** [August 15, 2024, 4:17pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/1 "2024-08-15T16:17:16Z")

</div>

I have a form with an upload field, and usually the user will upload many files at a time - but the submit button becomes available before all of the files are uploaded, so only the files that are finished get included in the submission.

Is there a way to force the submit button to remain unavailable until all files are finished uploading?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [August 15, 2024, 4:46pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/2 "2024-08-15T16:46:46Z")

</div>

Not natively, that I am aware of.  
The way I normally handle this is with a hint component to warn the user:

![CleanShot 2024-08-16 at 00.43.31@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/9/39d3fdcc3b2fa58d76e743fa8edc3df5cfa0fad4.png)

Not completely foolproof, but it generally works.

Quite possibly you might be able to do something with CSS, assuming you have a plan that supports it. Check out the below thread:

> [@Exploring the Enhanced Capabilities of Glide's Native Form](https://community.glideapps.com/t/exploring-the-enhanced-capabilities-of-glides-native-form/69876):
>
> I want to share about the additional capabilities that we can achieve with Glide’s native form. What I have tested with the help of CSS is that native forms can also be applied for validation. Create your validation in the table columns and present it through messages via the “hint” component. Add the visibility conditional and the class “prevent-submit” to these hint components. Add the following CSS code: /\*Container Form\*/ #page-root:has(.prevent-submi…

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [August 15, 2024, 5:39pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/3 "2024-08-15T17:39:43Z")

</div>

Because the number of images being uploaded is unknown, the following method can be used to actively prevent the form from being submitted:  
Provide a class name in the container: **uploadProcessing**

```auto
/*Uploading*/
#page-root:has(.uploadProcessing [data-testid="picker-image"] .uploading) [aria-label="Submit"] {
    pointer-events: none;
    opacity: 0.4;
}

```

Please help check, as I currently don’t have large file size images to test this accurately.

---

<div class="post-metadata">

**Author:** ![Kevin\_Eaton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevin_eaton/32/76162_2.png) [@Kevin\_Eaton](https://community.glideapps.com/u/Kevin_Eaton)\
**Post date:** [August 15, 2024, 7:34pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/4 "2024-08-15T19:34:32Z")

</div>

Could the button’s action be changed to “wait for condition”?  
Instead of the native “submit” you can change the action to include other actions. One of those is “wait for condition”.

If there is a way to have a data point on the data table for where the files are being uploaded then you could set up a column in the data table to show “Uploads Completed” and then when this column says that the condition is met. I’ve not done many data uploads at once like you are saying, but an example would be “if column File Upload # has url then **Upload Complete** ” If not, “wait for upload”.

---

<div class="post-metadata">

**Author:** ![Kevin\_Eaton](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kevin_eaton/32/76162_2.png) [@Kevin\_Eaton](https://community.glideapps.com/u/Kevin_Eaton)\
**Post date:** [August 15, 2024, 7:39pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/5 "2024-08-15T19:39:01Z")

</div>

My suggestion might only work if your initial add files button creates a new row before the submit button does. Not sure if it’d work, but maybe something like:  
Custom Action: Add Row + Show new screen for this item  
One new screen: All of your upload and text (this could be copied from the current add screen)  
On Submit: Set the wait for condition to check for uploads complete

---

<div class="post-metadata">

**Author:** ![Himaladin](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/himaladin/32/71023_2.png) [@Himaladin](https://community.glideapps.com/u/Himaladin)\
**Post date:** [August 16, 2024, 11:31am UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/6 "2024-08-16T11:31:30Z")

</div>

> [@Himaladin](#):
>
> `#page-root:has(.uploadProcessing [data-testid="picker-image"] .uploading)`

Apologies @Kellar, I copied the wrong code; it turns out that was for multiple image pickers. However, both have almost identical code, where one is [data-testid=‘picker-image’] and the other is [data-testid=‘picker-file’].

```auto
/*Uploading*/
#page-root:has(.uploadProcessing [data-testid="picker-file"] .uploading) [aria-label="Submit"] {
    pointer-events: none;
    opacity: 0.4;
}

```

---

<div class="post-metadata">

**Author:** ![Kellar](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/kellar/32/69515_2.png) [@Kellar](https://community.glideapps.com/u/Kellar)\
**Post date:** [August 16, 2024, 5:58pm UTC](https://community.glideapps.com/t/can-the-submit-button-be-made-to-wait-until-all-uploads-are-complete/75666/7 "2024-08-16T17:58:12Z")

</div>

Thank you @Himaladin; it looks great, but my plan doesn’t support CSS anyway, so I’m going to have to put a notice on the button.

OR, I may have the file upload occur after submission, since the form triggers a webhook that goes to zapier anyway; no big deal to add a step in the zap to text or email the google drive folder link.
