Dropzone.js submit form without file

I have an update form with some textfields and dropzone.js for uploading an image but the image should be optional. With the basis integration of dropzone the form won’t be submited unless at least one image is dropped. I have been googling almost all day but non of the mentioned sollutions seems to work at least not for me. The most mentioned way is:

if (myDropzone.getQueuedFiles().length > 0)
{                        
	myDropzone.processQueue();  
} else {                 
	myDropzone.uploadFiles([]);
}

within the click function. But as you can guess for me it isn’t working :cry: Is someone familiar with Dropzone and know how to handle this? Thank you in advance.

Could you post a jsfiddle sample link?(html+js)

I’m not really familiar with dropzone.js, but as I understand it the form is getting submitted automatically each time you drop a file; so if that file is optional, you’d simply have to add a regular submit button for submitting the form. But as @liontas76 said we’d have to see some more code to give you more specific help.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.