I get this plugin to do a upload of images: Angular File Plugin
I need that when I enter a new file, it create a form for each file containing some fields that I want to send with the file.
I could do this using the callback onAfterAddingFile
that follows:
uploader.onAfterAddingFile = function(fileItem) {
var f = document.createElement("form");
f.setAttribute('method',"post");
f.setAttribute('action',"submit.php");
var i = document.createElement("input"); //input element, text
i.setAttribute('type',"text");
i.setAttribute('name',"title");
f.appendChild(i);
document.getElementById("myForm").appendChild(f);
But now, I need to link each image with each form. I think that I need to create a custom attribute, like data-frm
for example, to link them, isn't? How can I do that?