Thank you all for your replies. I got it working with js!! But my concerns are the same as djr33's. What if they have js disabled, then the form is useless.
This is the code that works
PHP Code:
<form name="registerform" id="registerform" onsubmit="multiSubmit(this, '<?php echo site_url('wp-login.php?action=register', 'login_post') ?>');" onClick="return ActionDeterminator();" method="post">
<input type="hidden" name="check_submit" value="1" />
<p>
<label><?php _e('Username') ?><br />
<input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" tabindex="1" /></label>
</p>
<p>
<label><?php _e('E-mail') ?><br />
<input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" tabindex="2" /></label>
</p>
<p>
<input type="radio" name="reason" ><label>Banking</label><br>
</p>
<p>
<input type="radio" name="reason" ><label>Securities</label><br>
</p>
<p>
<input type="radio" name="reason" ><label>Insurance</label><br>
</p>
<?php do_action('register_form'); ?>
<p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
<br class="clear" />
<input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
<p class="submit"><input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Register'); ?>" tabindex="100" /></p>
</form>
Code:
<script type="text/javascript">
var secondActionStore = new Array();
var secondActionForm = new Array();
function multiSubmit(whichForm, secondAction){
if(navigator.userAgent.indexOf('Opera') >= 0)
window.open('about:blank', 'new_window', 'location=yes');
else
window.open('about:blank', 'new_window');
whichForm.target = 'new_window';
var i = secondActionStore.length;
secondActionStore[i] = secondAction;
secondActionForm[i] = whichForm;
setTimeout('secondActionActivate('+i+')', 1);
}
function secondActionActivate(i){
var whichForm = secondActionForm[i];
var secondAction = secondActionStore[i];
whichForm.target = '_self';
var firstAction = whichForm.action;
whichForm.action = secondAction;
whichForm.submit();
whichForm.action = firstAction;
}
</script>
<script type="text/javascript" language="JavaScript">
function ActionDeterminator()
{
if(document.registerform.reason[0].checked == true) {
document.registerform.action = 'http://www.hotmail.com';
}
if(document.registerform.reason[1].checked == true) {
document.registerform.action = 'http://www.yahoo.com';
}
if(document.registerform.reason[2].checked == true) {
document.registerform.action = 'www.google.com';
}
return true;
}
// -->
</script>
The other issue is, is it secure to have the data pushed through the url of the browser? When I submit, for a split second I can see the form info in the url bar on the browser, then it goes to the thank you page.
Thanks
Will
Bookmarks