1
votes

due to security and implementation reasons that are out of the scope of this post, I need to submit multiple forms in a single page to different iFrames (one iFrame for each form). I can't use jQuery nor AJAX, it has to be done via:

<script>
document.Form1.submit();
</script>

The problem is, after I submit the first form (everything goes well), I can't submit the other three forms. I'm guessing only one form.submit() call is allowed per page. Is there a way around this?? I have no problem with submitting all the forms at the same time.

Ps: I'm forwarding the post request to the iframe using the target param of the form. Like this:

<form id='Form1' name='Form1' action='https://www.xxx.com/index.php' method='post' target='iFrame1'>

Thanks a lot in advance for your time and help. Best regards,

1
this seems like a bad idea...bimbom22
I don't think it's a bad idea at all. Think of an multi image uploader for instance- I'm creating one now in fact. User clicks browse, selects image -> I wrap <input type="file" /> in a form control and output an iFrame, submit, validate the true file-type, size, etc and output to an iFrame Winter | JPG | 250 KB | (x)... They can then submit the overall form and all the <input type="file" style="display:none" /> will be uploaded in one form. I'm running into this same issue and I create unique ID's and names for each Form & iFrame...pixelbobby

1 Answers

0
votes

You can also have multiple forms and have each form submit to a separate iFrame.