View Full Version : can a form have 2 actions

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

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.

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

<form id="myForm" method="post"...>
<input ...>

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

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


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.


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


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum