Reputation: 3
I'm attempting to set up a same-page form submission mechanism for a client website. Their forms submit to a handler page which is on a different domain, so I cannot submit via ajax. Previously I have had success cloning my form into an iframe and submitting that (I don't need to retain control of the iframe, and I don't need to verify receipt, just post the data) but that is now being blocked in Chrome.
It would be relatively trivial to add cross-domain headers if I had control of the servers involved, but I don't.
Is there any way to resolve this, or do I have to tell my client that the method I was using is no longer available and they have no options without making server-side changes?
Upvotes: 0
Views: 974
Reputation: 1177
Just target the iframe. You can change form's target and action dynamically, if for example you need to reuse it for some other submission.
<form target="IFRAME_NAME">...
Upvotes: 0
Reputation: 943759
There's no need to clone the form. Just set target="iframe_name"
on the <form>
element.
Upvotes: 1