I have to use multiple dropzone areas to upload images. I have used the jQuery append()
function to dynamically create the div.
The problem is that the dynamically created dropzone is not initialized and therefore not working.
I have to use multiple dropzone areas to upload images. I have used the jQuery append()
function to dynamically create the div.
The problem is that the dynamically created dropzone is not initialized and therefore not working.
Here is the script i have used to do the same. I have changed the dynamically created input type text's name field by using the querySelector. The querySelector returns the reference of the elements which have custom attribute i have used data-tagline.
A bit late to the party but they thought about it. As stated in the usage part of the documentation:
You may have to create an element and set some properties manually.
Just make sure to call the plugin on that newly appended element. The problem is the plugin gets attached to only elements which were present initially.
So, call the plugin once again after you append the element so, it gets attached and works again.
dynamically create dz element:
append to div somewhere
start instance
add options