Skip to main content


 

Symptoms


We have a form, where a user can upload file attachments, followed by the user clicking a submit button.
However, if the file is large (upload takes some time), and the user clicks the submit button before the upload is done, then the file handling done in the submit-button-clicked rule will not handle the file (which is still being uploaded).

One solution would be to disable the submit button, while the file attachment control was working, but I can't seem to find any events except for: "Changed" on the control.

How would I go about making sure that the user can't click on the submit button until the file attachment control finishes uploading the file?
 

Diagnoses


How To
 

Resolution

When you initialize the view, you have to disable the "submit" or "upload" button. When "on change" happens with the upload control, you can enable the button again.

I reproduced this on SmartForms 1.0.7




 

(Note: I'm in K2 Five; I didn't see a Community area for K2 Five so posting here.)

 

This solution assumes that the file attachment field must be required, because the Save button isn't enabled otherwise.

 

What if you want the file attachment optional, but still want to disable the Save button until it's done uploading? Is this possible? Something like:

 

- If the FileAttachment field is in a loading/incomplete] state

 -- disable SaveButton control

 

Here's what I've tried so far:

  • (The solution above.)
  • An advanced condition, but didn't see any options there that fit.
  • Validating the file attachment field, but not making it required. I was still able to submit the form in the middle of the file uploading, it just didn't save the attachment at all.
  • Looking for a condition such as "if a control on a view is in a specific state", but there are only options for whether they contain a value or a specific value. Not sure if such a thing exists (I'm very new to K2).

Thanks to whoever can help!


Reply