Jump to content

two actions on form


gum1982

Recommended Posts

 

Can you make a form send off two sets of information?

 

Ive got a script generated from a auto responses service can i have it so that when i hit submit on the form i can send the information through to another page.

 

I guess what im saying is? is their a way to have two actions on this form so when submit is pressed it sends to

 

action="http://www.getresponse.com/cgi-bin/add.cgi"

 

but could i also send it to say action="process.php" aswell.

 

Is their a way to do this?

 

 

this is the form

 

<form action="http://www.getresponse.com/cgi-bin/add.cgi" method="post" accept-charset="UTF-8">

 

<!-- form input fields -->

 

</form><script type="text/javascript">var el=document.getElementById("custom_http_referer"); el.value = document.location; </script>

 

 

Link to comment
https://forums.phpfreaks.com/topic/179492-two-actions-on-form/
Share on other sites

Yes It is possible to submit one form to two actions. It requires some JavaScript manipulation. Here is how:

Have two iframes in the page. Switch the 'target' of the form and submit the form.

 

Sample code:

 

function submitMyForm() {
  document.contact_us.submit();
      document.contact_us.action = "Another.php";
      document.contact_us.target='k4';
      document.contact_us.submit();
      
      return false;
}

Link to comment
https://forums.phpfreaks.com/topic/179492-two-actions-on-form/#findComment-947583
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.