Inquiry on Dropzone with Validation

Yes I’ve tried with a form submit with validation. Get the accept message but not for required. Will try again in new form though just in case.

@patrick can you check again on Dropzone required validation. I’ve tested it again and again and figured out required validation message will only shows up on Dropzone input with multiple="" attribute. For single input, required validation message doesn’t work unless I add multiple="" on it. Respond please.

Thanks for the report, seems that I tested with multiple files selected and it always worked for me. I made an update, but it was to late for today’s update, it will be included in next weeks update. That leaves us some time to test it.

Here the updated file, let me know if there are still issues with it.

dmxDropzone.zip (3.1 KB)

1 Like

Alright. I’ve tested this one worked as expected. Just to make sure here that is it by design that Dropzone validation is only fired after all other inputs in the form been validated?

Sounds more like a small bug. Validation shouldn’t depend on other inputs unless you want it like that.

I thought so. Agreed.

We will have a look if we can implement it better, but for that we probably need to update more then just dropzone.

Technical explanation:
The dropzone validation is kind of hacked in. It isn’t a real html form element and so the html5 validation doesn’t work on it. We listen to the submit event of the form and validate it then directly within the dropzone component. But the html5 validation happens in an other event handler and stops it before the dropzone handler is triggered. Only after the rest of the form validation was correct the dropzone handler is triggered and it will validate itself.

2 Likes

Thank you for your explanation and commitment to fix it. :clap::clap:

And on form reset, please do remove dropzone is-valid class or return it to original state.

Hi. Was this not included in 2.2.6? It still isn’t working for single file drop zone.

You can test following update to dropzone, it should cleanup the validation classes:

dmxDropzone.zip (3.2 KB)

Tested and it does clean up the validation on reset as expected. Kudos and thanks for the improvement made! Cheers.