View Full Version : passing variables through a link
09-21-2005, 12:08 PM
I have an online form with 2 submit buttons.
Unfortunately the form can only be submitted to 1 place.
I need one button to submit to a _self page
The other to submit to a _blank page.
The only way I can think of doing this is to have one button as a link instead
Can I pass posted variables through a link?
09-21-2005, 12:19 PM
yes, if your form has a method of "get" you can submit as a querystring rather than as posted values. You could then redirect to the appropriate page using asp or php and just pass the whole querystring through to the processing page depending which button was pressed
document.formname.action = newaction;
<form action = "" method = "post">
<input type = "submit" name = "action1" value = "Button 1" onclick="changeAction('action1.php')">
<input type = "submit" name = "action2" value = "Button 2" onclick="changeAction('action2.php')">
09-21-2005, 01:20 PM
09-21-2005, 01:52 PM
not client side.
You would have to reload the page to do it with php. You could post everything through the querystring then redirect to the relevant processing page... eg
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.