1

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?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.