Hello,
I assume this one is rather a JavaScript/jQuery/DOM question than a Rails question, but it's all due to the way I implemented it in Rails.
I am trying to upload files while creating a new object (auction). While the user inputs some data, he shall also have the possibility to upload multiple photos.
The main problem is, that the files should be uploaded while filling out the form. And the form is a tabbed one, so the photos are on tab 3 of 5 and all tabs sit within the overall create form. That means, that the upload form has to be (DOM position) within the main form for creating the object, which is not allowed by the HTML specification.
To avoid nesting forms I tried to jQuery.clone() the file field when submitting the photo first, so I can create the upload form on the fly - but this didn't work, as JS doesn't seem to be able to access the value of a file field.
So my question is: how could I implement such a "submit form to hidden iframe" thingy, when I can't avoid to place the upload-only form within another form, from a DOM point of view? Does anyone know a good hint or something?
Thanks in advance for your help
Arne