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?
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
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ā.
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
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ā].
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.