dreamcatcher

msg:3915825 | 3:19 pm on May 18, 2009 (gmt 0) |
Ideally you give each button a unique name. When the form is submitted the button that is clicked is a part of the post array. The one that isn`t clicked isn`t. <input type="submit" value="Submit One" name="first" /> <input type="submit" value="Submit Two" name="second" /> if (isset($_POST['first'])) { // do something.. } if (isset($_POST['second'])) { // do something.. } Hope that helps. You might need to juggle some code around as well. dc
|
johnnie

msg:3916878 | 1:42 am on May 20, 2009 (gmt 0) |
Have you considered using a radio button to make the customer select? Then you can use some simple code to re-direct him or her based on the radio button status.
|
smokeyb

msg:3918817 | 10:36 pm on May 22, 2009 (gmt 0) |
Thanks for the help guys. I know that having the 2 submit buttons seems obvious but I just had the feeling it wasn't right (my knowledge of these things is the opposite to "extensive"), and I had played with the idea of dupicating the form for each action, but hiding the usused form somehow. I'll play around with both the suggestions and it is no real big if I have to opt for duplicate forms - it just looks prettier the way I want it. Thanks
|
rocknbil

msg:3919079 | 4:17 pm on May 23, 2009 (gmt 0) |
| Ideally you give each button a unique name. |
| While a unique ID is generally useful for DOM and Javascript referencing, a unique name is not required on input type="submit." It will work just like a radio button unless your browser is doing something funky. Try it. <input type="submit" value="Submit One" name="SubmitButton"> <input type="submit" value="Submit Two" name="SubmitButton"> if (isset($_POST['submitButton']) && ($_POST['submitButton']=='Submit One')) { // action 1 } else { // action 2 }
|
|