"Value" in dropdown

General ShopSite user discussion

"Value" in dropdown

Postby gene » Fri Jul 17, 2009 12:59 am

My products have its own subproducts and I use a dropdown to list those subproducts. Inside the dropdown, the code has <option value="[-- PRODUCT.RecordNumber --]">. What will happen I change the "value" to a filename of an image? I will use javascript that if customers select an item inside the dropdown, the product image will also change. So I want to know if I can change this value?
gene
 
Posts: 122
Joined: Mon Feb 09, 2009 10:54 pm
Location: Philippines

Postby Jim » Fri Jul 17, 2009 8:02 am

If you change the value then it will not work. The value of the product record number must be that in order for the form to submit the correct product to the shopping cart when you click the add to cart button.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Postby JeremeD » Fri Jul 17, 2009 10:57 pm

You don't have to use the value attribute for your image. If you are using something like JQuery, you can simply make up more meta data for the <option> tag.

For example, you could have

<option value="[-- Product.RecordNumber --]" image="image_url_here">

JQuery can read this perfectly and the image attribute you made will just be ignored as the form is processed by shopsite. Do note that this won't validate, but that's not a huge deal anyway.
SD360.com
Certified ShopSite Designer
ShopSite Templates Available Now
JeremeD
 
Posts: 60
Joined: Sat Feb 10, 2007 4:20 pm
Location: Athens, GA


Return to User Forum

Who is online

Users browsing this forum: No registered users and 144 guests