Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts

    my product form adds all items to the cart when only ones selected

    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.

    Code:
     <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
    Last edited by hheyh222; 11-11-2010 at 07:53 PM.

  • #2
    New Coder
    Join Date
    Nov 2004
    Posts
    55
    Thanks
    8
    Thanked 2 Times in 1 Post
    Code:
    <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.

  • #3
    New Coder
    Join Date
    Sep 2010
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    thanks for trying, but it still did the same thing.

  • #4
    New Coder
    Join Date
    Sep 2010
    Posts
    32
    Thanks
    2
    Thanked 0 Times in 0 Posts
    could it be that i dont have quantity specified?
    how would i fix that with how i have it set up?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •