Wizards and attachments

Hello,

I created a form with a wizard in 4 steps.
Each step requires attachments to be uploaded.

The number of attachments can be of a certain consistency both in number and in size.

For this reason I would like that, when the user has clicked on the "submit" button in the last section of the wizard, he will be informed that there are uploads to be completed and not to close the browser page and wait for the confirmation that the forms has been submitted.

Alternatively, I would like to disable the "Submit" button until all uploads are complete but showing a warning that the button will be atcivate when all uploads will be complete.

I thanks in advance whoever will want to help me and since this is my first post, i want to say hello to all of you.

Regards

Hello @vigand,

Welcome to Plumsail Community!

You can either disable the submit button, or add form validation. You can find the code samples in this post:

Thank you very much, i will try using what i find in the topic you quote.

Btw i have lots of different attachmentes sections so i have to modify the code to retrieve the uploading status of every attachments section. It's a form for a Real Estate Company and they need to split the uploaded photos for every room of the properties they managed.

Thank you

@vigand,

In this case adding form validation is what you can try out:

fd.validators.push({
    name: 'MyCustomValidator',
    error: 'Wait for files to upload',
    validate: function(value) {
        if (fd.field('Attachments1').isUploading || fd.field('Attachments2').isUploading || fd.field('Attachments3').isUploading)
          return false;

        return true;
    }
});

I've preferred not to use the error as warning in validation.

I entered a text box with a warning to wait and not to close the page.
I've hidden the text when form load and i show it as validation's true condition.

In this way, after user submit the form, validation shows the warning and there is no risk that the user will misunderstand the message as an error.

Thanks btw.

1 Like