PHP question regarding multiple submit buttons
Posted: Thu Nov 02, 2006 2:01 pm
Burrito | Please use
In the form, there is a size and color of the product, which the user selects, as well as the product id, which is a hidden field, like this:
Now - the trick is, I have to add another button that adds the product to a wish list instead of the cart - in other words, this button will have to pick up the values of the color and size, but then once it hits the cart.php, cart.php needs to know that this button was clicked and it should redirect the user to the wish list coded page with the proper values for the size and color.
Is there a simple way of doing this or am I deluding myself? Also, I put it under php rather than javascript because I would love to do this with php - but if there is some javascript that has to be added I am fine with that as well.
Thanks so much in advance for any help!
Burrito | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I have a form that adds a product into a user's cart.
Let's say it's this:Code: Select all
<form action=cart.php>
</form>Code: Select all
<form action=cart.php>
<select name="size" id="size">
<option value="4x">4x</option>
<option value="5x">5x</option>
<option value="6x">6x</option>
</select>
<select name="color" id="color">
<option value="red">red</option>
<option value="blue">blue</option>
</select>
<input type="submit" name="Submit" value="Add to Cart">
</form>Is there a simple way of doing this or am I deluding myself? Also, I put it under php rather than javascript because I would love to do this with php - but if there is some javascript that has to be added I am fine with that as well.
Thanks so much in advance for any help!
Burrito | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]