Forum Moderators: open
I would appreciate your help on my problem :
I need to submit two forms with one button.
The web site i'm developing allows merchants to order parts and others things else and in function of their activity, the right supplier form page is loaded in an iframe. Submitting the fist form must send twice the two forms, but i get an error : permission denied to get Window.submit property.
Is there a way to fix this?
Thanks in advance.
I'm assuming the second form you want to submit is in the IFRAME on the supplier site, you cannot access any javascript or other objects in a different domain, hence your permission denied.
The only thing you could do is change the IFRAME src, and use the URL to pass the form data. Your suppliers form may use this method on their form submission anyway, in which case you could mimic the effect.
The best solution would be to split the form on the server instead of trying to put it into two forms on the page.
whatever.php?name=ONE&demo=TWO&blah=THREE
or
'www.example.com?name=' myName "$_POST['name']
and pass the dublicate variables through a URL to your "hidden" form.
If everything works right your user may see a slight flicker as the first form post then redirects to the second "hidden" form which automatically submits its dublicate values to wherever you want them posted at which point it could redirect to a Thank you page or something.
Very crude, yes.
There are much more elegant ways I'm sure.
But it can work.
Thus, i have a function which duplicate data from one field to another hidden field in function of supplier website.
paratge, let me state an example and tell me if I'm right....
Your page on www.mydomain.co.uk has a form, for e.g. name, address, phone....
Your page then IFRAME's to www.supplier.co.uk who has a form name, address, phone, etc...
What you're trying to do is make the customer fill in the form on your site and post that to the supplier site?
So you're trying to get your submit function to 'press' the submit button on the supplier site?
Assuming that's right, how have you got the data across to the suppliers form?