[QUOTE=skustes;615500]
I then pulled a query from the database of the attributes with the 3 fields that I need to build my SELECT. I'm sticking both the numeric value that is used to set the Zen Cart attribute selection (the one we hide with that STYLE there at the top) and the image I want to call. They are separated with a hyphen so the Javascript can split them.
I like to have my dropdown like this but where to put this code?Code:<style type="text/css"> #attrib-1 {display: none;}; </style> <!-- this is the table that is used you may need to change size based on your needs --> <table border="0" cellspacing="0" cellpadding="0" width="234"> <tr> <td width="134"> <?php $colorsquery = mysql_query("SELECT options_values_id,attributes_image,products_options_values_name FROM ztest_products_options_values,ztest_products_attributes WHERE ztest_products_options_values.products_options_values_id = ztest_products_attributes.options_values_id AND options_id = 1 ORDER BY `products_options_values_sort_order`,`products_options_values_name`") or die(mysql_error()); ?> <!--this calls the picture change function--> <select name="colorselection" onChange="showimage()"> <?php while ($currentcolor = mysql_fetch_array($colorsquery)) { echo "<option value='$currentcolor[0]-$currentcolor[1]'>$currentcolor[2]</option>"; } ?> </select> </td> <td width="100" align="center"> <align="center"><img src="images/attributes/black.gif" name="colorimage" style="border-width:1px; border-color:#000000; border-style:solid;"> </td> </tr> </table>



