Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Dynamic Select Field?
10-28-2006, 06:55 AM #1
- Join Date
- Jul 2005
- Thanked 0 Times in 0 Posts
Dynamic Select Field?
I've run into a snag and would really appreciate some help!
I have many colors/sizes of a particular product. Each item has a different SKU number, and each item has a different ProductID number.
ID Product Name ProductSKU Color Size
3345 Product-A 24062-19 Green 8
3346 Product-A 24062-20 Green 10
3347 Product-A 24063-19 Red 8
3348 Product-A 24063-20 Red 10
The customer should only see the product once on the page, and then be able to select the color and size. I'm trying to figure out how to grab the correct SKU number depending on the color/size the customer chooses.
I know I can use something like:
<select name="color" onchange="this.form['product_no'].value=this.value">
<option>Select a Color...</option>
10-28-2006, 11:45 PM #2
- Join Date
- Oct 2006
- Denver, Colorado USA
- Thanked 333 Times in 325 Posts
I cannot offer any specific coding to do this, but here are some thoughts -
Typically, to keep the form code generic, there would only be codes/values for the sizes and colors and these would be sent to the server when the form/order is submitted. The order processing code would determine the actual product ID/SKU...
If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.