Dropzone Required Validation Throwing Error In Console

Wappler Version : 3.2.2
Operating System : Windows 10 2004

<input class="d-flex border-danger" is="dmx-dropzone" id="dz_Attachments" type="file" name="Attachments[]" multiple message="" accept=".png,.jpg,.jpeg,.pdf" data-msg-accept="Only PDF, JPG, JPEG and PNG file types are allowed." data-rule-maxfiles="5" data-rule-maxtotalsize="10485760" data-msg-maxtotalsize="Total size of selected files should be no more than 10mb." data-msg-required="Please upload at least 1 file." dmx-bind:required="ShowSection.value == 3" data-rule-minfiles="1" data-msg-minfiles="Please select at least 1 file." data-msg-maxfiles="Please select no more than 5 files.">

The required validation should show appropriate message.

Actual behavior

image

How to reproduce

I am validating the dropzone’s required validation on button click like so dz_Attachments.validate()
On doing this, I see the above error in browser console.
I see the same error when I try to run the validate function using dmx.parse.
I also tried removing the dynamic required validation, but it did not make a difference.

Please help.

Please test following update.

dmxDropzone.zip (3.2 KB)

Not seeing the error in console anymore. But the validation message is still not showing up.

In regular input fields, I see a div created to show error message: <div id="dmxValidatorErrorFormSUB" class="invalid-feedback"></div>
But not seeing anything for DropZone.
I have data-msg-required set in the control (as in the code above).

Had to make some changed in the app connect core also, here the updated files that you can test.

dmxAppConnect.zip (21.9 KB)
dmxDropzone.zip (3.2 KB)

No luck.
I checked my code again… it looks like the validate() method is not validating the control correctly. I have 2 validations in place: minimum 1 file and dmx-bind required.
But, after running validate() on the control in browser, the invalid property still returns false.

It should work with the form validate, but forgot to also bind it to the component validate. Here a new update.

dmxAppConnect.zip (21.9 KB)
dmxDropzone.zip (3.3 KB)

Working now. Thanks. :slightly_smiling_face:

Fixed in Wappler 3.3.2

This topic was automatically closed after 31 hours. New replies are no longer allowed.