Hi there, I realize this is a group for PHP, but this question is related.
What I want to do is have one action in a form execute if the user clicks on one button, and another action execute if the user clicks on another button. The actions will point to PHP programs.
Can someone fill me in on what the HTML is for this. I can't remember.
Thanks a bunch in advance, Dimitri Marshall
This is a JavaScript item. Being that this is a php list, and I haven't messed with JavaScript in quite some time, my syntax may be a bit off, but it should get you going....
Setup the form the way you normally would, with the action of the form set to the first page you want it to submit too. For the second page, you'll need to set up a JS function, something like...
function submitForm(){ document.forms[0].action = 'url/of/second/page.php'; document.forms[0].submit; }
And your second button would be like this....
<form onSubmit="submitForm()"> <input type="submit" value="Second Button" /> </form>
The second button needs to be placed outside of your first form. Like I said, my syntax is probably a bit off, but this is the general idea.
-- By-Tor.com It's all about the Rush http://www.by-tor.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php