...

View Full Version : my product form adds all items to the cart when only ones selected



hheyh222
11-11-2010, 08:45 PM
Ive worked with forms a bit but not one thats selecting items to buy to go to a cart. Originally, it was a bunch of individual codes for the different items, but I wanted them in a select box, so i frankensteined the code, but it doesnt work exactly right.



<form method="POST" action="https://www.asecurecart.net/server/cart.aspx/Myareasbest">
<input type="hidden" name="ID" value="option1">
<input type="hidden" name="Describe" value="One Year">
<input type="hidden" name="Price" value="300.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option2">
<input type="hidden" name="Describe" value="Three Years">
<input type="hidden" name="Price" value="750.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option3">
<input type="hidden" name="Describe" value="Five Years">
<input type="hidden" name="Price" value="1,200.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option4">
<input type="hidden" name="Describe" value="Bronze Corporate Membership">
<input type="hidden" name="Price" value="1,000.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option5">
<input type="hidden" name="Describe" value="Silver Corporate Membership">
<input type="hidden" name="Price" value="1,200.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option6">
<input type="hidden" name="Describe" value="Gold Corporate Membership">
<input type="hidden" name="Price" value="2,000.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option7">
<input type="hidden" name="Describe" value="My Best Card">
<input type="hidden" name="Price" value="25.00">
<input type="hidden" name="Multi" value="N">
<select name=select>
<option value="option1">One Year $300.00
</option>
<option value="option2">
Three Years $750.00

</option>
<option value="option3">
Five Years $1,200.00

</option>
<option value="option4">
Bronze Corporate Membership $1,000.00


</option>
<option value="option5">
Silver Corporate Membership $1,200.00<br>


</option>
<option value="option6">
Gold Corporate Membership $2,000.00


</option>
<option value="option7">
My Best Card $25.00


</option>
</select>
<br>
<input type="submit" name="Submit" value="Add to Cart">
</form>



All of the hidden fields were originally right with the options, but the drop down box didnt work at all, so I moved them all to the top and now it looks right but doesnt select right.

heres my temp link
http://****************/Copy%20of%20confirm.html
Thanks

dustywb
11-12-2010, 07:26 AM
<form method="post" action="https://www.asecurecart.net/server/cart.aspx/Myareasbest">
<input type="hidden" name="ID" value="option1">
<input type="hidden" name="Describe" value="One Year">
<input type="hidden" name="Price" value="300.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option2">
<input type="hidden" name="Describe" value="Three Years">
<input type="hidden" name="Price" value="750.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option3">
<input type="hidden" name="Describe" value="Five Years">
<input type="hidden" name="Price" value="1,200.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option4">
<input type="hidden" name="Describe" value="Bronze Corporate Membership">
<input type="hidden" name="Price" value="1,000.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option5">
<input type="hidden" name="Describe" value="Silver Corporate Membership">
<input type="hidden" name="Price" value="1,200.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option6">
<input type="hidden" name="Describe" value="Gold Corporate Membership">
<input type="hidden" name="Price" value="2,000.00">
<input type="hidden" name="Multi" value="N">
<input type="hidden" name="ID" value="option7">
<input type="hidden" name="Describe" value="My Best Card">
<input type="hidden" name="Price" value="25.00">
<input type="hidden" name="Multi" value="N">

<select name="select">
<option value="option1">
One Year $300.00
</option>
<option value="option2">
Three Years $750.00
</option>
<option value="option3">
Five Years $1,200.00
</option>
<option value="option4">
Bronze Corporate Membership $1,000.00
</option>
<option value="option5">
Silver Corporate Membership $1,200.00
</option>
<option value="option6">
Gold Corporate Membership $2,000.00
</option>
<option value="option7">
My Best Card $25.00
</option>
</select>
<br />
<input type="submit" value="Add to Cart">





Edited it a bit and found a couple errors there were not quotes around the select menu's name and also made it a bit easier to read, everything else looks ok. It could be the problem of the form processor script as well if this doesn't work.

hheyh222
11-12-2010, 02:53 PM
thanks for trying, but it still did the same thing.

hheyh222
11-12-2010, 03:24 PM
could it be that i dont have quantity specified?
how would i fix that with how i have it set up?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum