Hi, I just tried this code but i’m not sure if it worked. The javascript should set those attributes and then the form gets posted after. However, when I look at the posted attributes, they didn’t seem to get set by the Javascript so I din’t think the code worked.
var obj=document.getElementById('uploader');
var att = {"room_name":"room", "album_title":"album", "path":"path"};
for(var n in att) {
obj.setAttribute(n, att[n]);
}
For a start, those aren’t standard attributes, so you should not be using them. But they aren’t getting “posted” because there is no reason to. The browser doesn’t post attributes. It’ll post the file and the name, and that’s it. That’s how forms work (whether GET or POST) - they supply name-value pairs of data.
If you want all that stuff to somehow get communicated to the server, you need to add a few <input type=“hidden”> elements, one for each name-value pair you want.