gum1982 Posted October 29, 2009 Share Posted October 29, 2009 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 More sharing options...
milesap Posted October 29, 2009 Share Posted October 29, 2009 There is no way to do this, a browser only supports one action. On the PHP side, take the form that was submitted via $_POST[] and you can then pass that variable on to another function etc. Link to comment https://forums.phpfreaks.com/topic/179492-two-actions-on-form/#findComment-947042 Share on other sites More sharing options...
ILMV Posted October 29, 2009 Share Posted October 29, 2009 No, the browser will only send the form to one destination... would it not be possible to send it one on destination, and when it have finished send it to another? Edit: Damn it, too slow... +1 what milesap said Link to comment https://forums.phpfreaks.com/topic/179492-two-actions-on-form/#findComment-947045 Share on other sites More sharing options...
gum1982 Posted October 29, 2009 Author Share Posted October 29, 2009 I just what it to pass through the variables of email and name to the next page after submit so i can store these values as well. Link to comment https://forums.phpfreaks.com/topic/179492-two-actions-on-form/#findComment-947057 Share on other sites More sharing options...
prasanthmj Posted October 30, 2009 Share Posted October 30, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.