...

View Full Version : can a form have 2 actions



playing4glory7
06-30-2004, 02:04 PM
in other words how do i create my form on my sign up page to write to my join php file and go to my payment page when the submit button is click

sad69
06-30-2004, 06:14 PM
Well what you could do is have your form target="_blank", so it'll submit to a pop-up window, or include a hidden iFrame on your page and submit to it (also using the target attribute). Instead of having a submit input, just have a button that calls submit and redirects the page.



<script>
function submitRedirect() {
var frm = document.getElementById('myForm');
frm.action = 'join.php';
frm.target = '_blank';
frm.submit();

location.replace('payment.php');
}
</script>
</script>
<form id="myForm" method="post"...>
<input ...>
...

<button onclick="submitRedirect()">submit</button>
</form>


I think that should work. If you have a questions or problems, just post back.

Sadiq.

Roy Sinclair
06-30-2004, 10:28 PM
Please read the rules again, it's all part of being a member in good standing of this community.

http://www.codingforums.com/showthread.php?t=41037

sad69
06-30-2004, 10:33 PM
Heh, I didn't even think of the PHP solution.. nice one though, much cleaner!

Sadiq.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum