473,320 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
3 1532
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Matt | last post by:
I want to submit the form to the server without opening another page. When we do the following, it will submit the form data in myform to the IIS, and open page2.asp. <form name="myform"...
3
by: Megha Vishwanath | last post by:
Hi, I have a struts form <html:form> in which although the focus rests on the submit button, hitting the enter key does not submit the form. I tried capturing the Enter key event and followed...
4
by: pizzy | last post by:
INTRO: I tried to clean it up for easy reading. I hope I didn't make any mistakes. PROBLEM: WOW, this is some crazy sh!t. I can't get my checkbox (see "TAGSELECTED") to print my textboxes (see...
3
by: Chung | last post by:
Hi all, I have used the following code for doing the form submission. I don't think this is a right way to submit a from to a new aspx page because I need to add a dummy form in between. Could...
8
by: Gert | last post by:
Hi, I have a form (server side) because of the filling of variables through the application. But now I need to post it to an url on submit. My .HTML form looks like this, but how to translate it...
3
by: awebguynow | last post by:
in other words, Can I make client side mod's before I submit a form and Post ? I guess its just a matter of cycling through the form elements and setting value to null (or empty string) for...
7
by: jmp | last post by:
(I hope this isn't considered too far off-topic.) I work as a developer on a browser product found on handheld devices, and I'm trying to specify behavior for the browser to make it "as...
1
by: jatrojoomla | last post by:
Hi, I am New in JS world, I want's to submit a from using JavaScript ? is it possible? if yes then how? how to impliment document.form.submit? plz help me.
7
by: Dave Kelly | last post by:
There has to be a name for what I want to do and I don't know what words to google for. I have a form here: http://www.texasflyfishers.org/firstpage.htm I want to submit it to the server and...
11
by: thatguyNYC | last post by:
This is a complicated one... I have a modal form that lets the user preview some text, then either click Submit or Close. This form is called from several other forms. What I would like, since...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.