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

Discussion in 'Javascript' started by abansal.itp@gmail.com, Jun 22, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. On Jun 21, 8:59 pm, 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?
    Skye Shaw!@#$, Jun 22, 2007
    #2
    1. Advertising

  3. Guest

    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!@#$" <> wrote:
    > On Jun 21, 8:59 pm, 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, 2007
    #3
  4. Guest

    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, 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!@#$" <> wrote:
    >
    >
    >
    > > On Jun 21, 8:59 pm, 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, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Cheng[MSFT]
    Replies:
    0
    Views:
    863
    Steven Cheng[MSFT]
    Sep 22, 2005
  2. The Crow
    Replies:
    2
    Views:
    4,371
    Bruce Barker
    Sep 27, 2005
  3. Replies:
    4
    Views:
    901
  4. Harry
    Replies:
    3
    Views:
    359
    Harry
    Jan 12, 2006
  5. plex4r
    Replies:
    0
    Views:
    149
    plex4r
    Mar 7, 2006
Loading...

Share This Page