I'm currently working on a form which besides all of the normal fields of a form, also has file inputs to upload pictures, which onchange submits the picture to an iframe, then dinamically loads the uploaded picture into the form with fields to be modified for them (like name and geo-localization). Since I can't nest forms, the file_input is also contained in an iframe, so in the end I use an iframe inside of an iframe. So schematically, I have something like this:
<form>
<!-- LOTS OF FIELDS!! -->
<iframe src="file_input_url">
<!-- iframe which loads a page of a form with a file input-->
</iframe>
</form>
and the html loaded in the iframe is something like (ignoring html, head and body tags)
<form target="upload_iframe">
<input type="file" onchange="this.form.submit()">
</form>
<iframe name="upload_iframe"></iframe>
This works great, except that it takes a couple of seconds to load the first iframe, so the file input does not load with the rest of the page and is visually not ideal. I could solve this if it would be possible to specify the iframe content without needing to load another page (specified by 'file_input_url' in the first iframe).
So, my question is, is there a way to specify the iframe content in the same document, or can it only be speficied with the src attribute, so loading another page is required?