Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #18767

Re: How to submit a form with two actions?

From Stefan Weiss <krewecherl@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: How to submit a form with two actions?
Date 2013-03-08 02:55 +0100
Organization albasani.net
Message-ID <khbgf5$6io$1@news.albasani.net> (permalink)
References (2 earlier) <0da7e141-5cec-4509-a733-b50a01aae916@googlegroups.com> <hr9_s.6798$sI3.365@newsfe22.iad> <XnsA17D732DFA7eejj99@194.109.133.133> <jO9_s.63643$I12.60573@newsfe16.iad> <8ca39b18-36ed-43f4-b196-922a8344de4b@googlegroups.com>

Show all headers | View raw


On 2013-03-08 01:43, justaguy wrote:
> Ok. Now, probably my customer's site is using php (they use
> WordPress), and I'm not a php programmer. Question (allow me), does php
> have a way to pass submitted form data to a remote script, say,
> http://111.222.333.444/remoteScript
> (that's my server side script).

Then do it the other way around. Have the form submit to your new URL
and send a call to the legacy URL from your own server-side script.

Daniel is right that you shouldn't trust the client to successfully send
two requests in sequence. Even with a server-side approach, you'll have
to find a way to make sure that the two actions will be performed as one
transaction (i.e., either both or none).

If you absolutely have to do it from the client side, forget about
submitting the same form twice - that won't work (reliably). Have your
submit handler send an XHR to one of the URLs, and after you get the
response from that, submit() the form to the other URL.


Please stop top-posting, and try to quote only the text you're referring to.


- stefan

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 13:18 -0800
  Re: How to submit a form with two actions? Danny <dann90038@gmail.com> - 2013-03-07 14:40 -0800
    Re: How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 14:46 -0800
      Re: How to submit a form with two actions? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-03-07 15:31 -0800
        Re: How to submit a form with two actions? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-03-08 00:42 +0100
          Re: How to submit a form with two actions? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-03-07 15:55 -0800
            Re: How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 16:43 -0800
              Re: How to submit a form with two actions? Stefan Weiss <krewecherl@gmail.com> - 2013-03-08 02:55 +0100
                Re: How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 18:09 -0800
                Re: How to submit a form with two actions? Stefan Weiss <krewecherl@gmail.com> - 2013-03-08 04:21 +0100
                Re: How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 19:37 -0800
                Re: How to submit a form with two actions? Stefan Weiss <krewecherl@gmail.com> - 2013-03-08 13:18 +0100
    Re: How to submit a form with two actions? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-08 20:51 +0100
  Re: How to submit a form with two actions? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-03-07 23:52 +0100
  Re: How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 15:16 -0800
    Re: How to submit a form with two actions? Danny <dann90038@gmail.com> - 2013-03-07 15:22 -0800
    Re: How to submit a form with two actions? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-03-08 00:37 +0100
      Re: How to submit a form with two actions? justaguy <lichunshen84@gmail.com> - 2013-03-07 16:44 -0800
    Re: How to submit a form with two actions? Denis McMahon <denismfmcmahon@gmail.com> - 2013-03-09 05:09 +0000
  Re: How to submit a form with two actions? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-03-08 20:50 +0100

csiph-web