By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,029 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,029 IT Pros & Developers. It's quick & easy.

submit 1 form to 2 servers or 2 forms to 2 server (1 form each) on 1 submit

P: n/a
Hi,

I want to submit some data to 2 servers when user clicks a submit
button.

So I tried creating a hidden form and on submit, I called a java
script function which submits the hidden form first and then the other
form. But when hidden form is submitted, then control does not go back
to next submit and so nothing happens on 2nd server.

I am feeling that java script should be able to do this and I am doing
something incorrectly. Can you please suggest how can I solve this?

-nahk

Jun 22 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Jun 21, 8:59 pm, abansal....@gmail.com wrote:
Hi,

I want to submit some data to 2 servers when user clicks a submit
button.

So I tried creating a hidden form and on submit, I called a java
script function which submits the hidden form first and then the other
form.
That should work.
But when hidden form is submitted, then control does not go back
to next submit and so nothing happens on 2nd server.
Post the code you're using. What response do you expect from the 2nd
server?
What browser are you trying it on? Are you testing via the file or
http specifier?
Jun 22 '07 #2

P: n/a
Here is the relevant code

function submitForms()
{
document.form1.limit.value = document.form2.amountLimit.value
document.form1.submit()
document.form2.submit()
}

Here first form1 is expected to update limit value in database and 2nd
server is a payment gateway and is expected to take control.

I am trying it using firefox, and will try it with IE today and let u
know my observations.

Not sure whether I got your last question or not, but I guess I am
testing using http specifier. :)

On Jun 22, 12:06 pm, "Skye Shaw!@#$" <skye.s...@gmail.comwrote:
On Jun 21, 8:59 pm, abansal....@gmail.com wrote:
Hi,
I want to submit some data to 2 servers when user clicks a submit
button.
So I tried creating a hidden form and on submit, I called a java
script function which submits the hidden form first and then the other
form.

That should work.
But when hidden form is submitted, then control does not go back
to next submit and so nothing happens on 2nd server.

Post the code you're using. What response do you expect from the 2nd
server?
What browser are you trying it on? Are you testing via the file or
http specifier?

Jun 23 '07 #3

P: n/a
Acutally here the problem is first server on form1 submit is sending
an empty html file and that's why nothing happens.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY></BODY></HTML>

I have tried with IE as well and there also its the same problem.

Any ideas how can i fix this?
On Jun 23, 12:08 pm, abansal....@gmail.com wrote:
Here is the relevant code

function submitForms()
{
document.form1.limit.value = document.form2.amountLimit.value
document.form1.submit()
document.form2.submit()

}

Here first form1 is expected to update limit value in database and 2nd
server is a payment gateway and is expected to take control.

I am trying it using firefox, and will try it with IE today and let u
know my observations.

Not sure whether I got your last question or not, but I guess I am
testing using http specifier. :)

On Jun 22, 12:06 pm, "Skye Shaw!@#$" <skye.s...@gmail.comwrote:
On Jun 21, 8:59 pm, abansal....@gmail.com wrote:
Hi,
I want to submit some data to 2 servers when user clicks a submit
button.
So I tried creating a hidden form and on submit, I called a java
script function which submits the hidden form first and then the other
form.
That should work.
But when hidden form is submitted, then control does not go back
to next submit and so nothing happens on 2nd server.
Post the code you're using. What response do you expect from the 2nd
server?
What browser are you trying it on? Are you testing via the file or
http specifier?- Hide quoted text -

- Show quoted text -

Jun 23 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.