Good morning! I'm back with a couple of questions...
I have accomplished:
-placing the color selector on the page for both the background and the font color.
-successfully updating the preview with the selections
-successfully pass this information to the cart
-learned much more about ID's and stacking js to have mutliple events happen, which is where my question comes in...
I have the js stacked so that if a background image is selected, the background color text box displays a value of "no color". I also have it to where if a background color is selected, the background image button becomes unchecked. Awesome huh?!
The way I achieved the unchecked value is to assign a unique ID to each background image button (id=bkgrd1, id=bkgrd2)...as when I just assign one ID it doesn't uncheck.
Since I will have many images, how can I avoid having to write each and every event for each and every id?
Background Image:
Code:
<input type="radio" id="bkgrd_image" name="optn2" value="414" onclick="updateoptimage(0,2,0,1);updateprice0();document.getElementById('cardTemplate').style.backgroundImage='url(designer/images/pics/backgrounds/3bamboo.jpg)';document.getElementById ('background').value=this.src;document.getElementById('background').value='No Color';" />
Background Color:
Code:
<input type="hidden" name="optn23" value="479" id="noart" />
<img src="/images/designer/color.jpg" align="absmiddle" title="Choose Color" style="cursor:pointer" onclick="document.getElementById('noart').checked=true;document.getElementById('cardTemplate').style.backgroundImage='url(../images/sp.gif)';showColorGrid3('voptn23','cardTemplate','B');document.getElementById ('background').value=this.src;document.getElementById('bkgrd_image').checked=false;document.getElementById ('background').value=this.src;document.getElementById('bkgrd_image2').checked=false;document.getElementById ('background').value=this.src;document.getElementById('bkgrd_image3').checked=false;"/>
Thanks in advance!