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


Groups > comp.lang.javascript > #18758

Re: How to submit a form with two actions?

Newsgroups comp.lang.javascript
Date 2013-03-07 15:16 -0800
References <d7794c16-2790-4efb-b512-fba93780e624@googlegroups.com>
Message-ID <df2aecfa-053e-4b2b-aa6e-962e16acecc5@googlegroups.com> (permalink)
Subject Re: How to submit a form with two actions?
From justaguy <lichunshen84@gmail.com>

Show all headers | View raw


Hi,

Thanks.  Your code makes more sense.  I changed the   
f.method = 'get'; // ! ;-) 
to
'POST' method because I don't want form data to show up at URL level.

Outcome:
it brought up another tab for action2.html
but action1.html has not been processed.

Tested with Chrome 25, Safari 5.05 and Firefox 19.

Any further thoughts?


>On Thursday, March 7, 2013 4:18:19 PM UTC-5, justaguy wrote:
> Is it possible?  If so, the following script does not work, what's wrong?  Thanks.
> 
> 
> 
> <script type="text/javascript">
> 
> 	
> 
> 	function doubleSubmit(f)
> 
> 		{
> 
> 		  // submit to action in form
> 
> 		  f.submit();
> 
> 		  // return false;
> 
> 		  
> 
> 		  // set second action and submit
> 
> 		  // f.target="_blank";
> 
> 		  f.action="action2.html";		  
> 
> 		  f.submit();
> 
> 		  // return false;
> 
> 		}
> 
> 
> 
> </script>
> 
> 
> 
> <form name="checkout" method="post" action="action1.html" onsubmit="doubleSubmit(this)">
> 
> 	<input type="text" name="customer">
> 
> 	<input type="hidden" name="dev" value="test">
> 
> 	<input type="submit" name="send" value="Place Order">
> 
> </form>

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