[Javascript] Help to debug this
Marcelo Wolfgang
grillo at gmail.com
Wed Aug 16 18:51:40 CDT 2006
Hi list,
I need some help, my javascript abilities are very very rusted, and
they never were that good.
Can someone here please tell me why nothing happens in the above code ?
<script type="text/javascript">
function addToCart(catalogID){ window.location='cart.cfm?act=add&storeOwner=paula&item_id='+catalog.ID+'&prodSize='+getElementByID(prodSizeSelect).value+'&prodColor='+getElementByID(prodColorSelect).value;
}
</script>
Here's the HTML:
<div id="prodDescription">
<div id="prodDesc-size">
<div id="prodSize-dropdown">
<select id="prodSizeSelect" name="prodSize">
<option value="P">P</option>
<option value="M">M</option>
<option value="G">G</option>
</select>
</div>
</div>
<div id="prodDesc-color">
<select id="prodColorSelect" name="prodColor">
<option value="dourado">dourado</option>
<option value="uva">uva</option>
<option value="preto">preto</option>
</select>
</div>
<div id="prodDesc-addToCart"><a href="##"
onClick="document.getElementById('item-added').className='show';addToCart(5);">Colocar
no carrinho<img src="images/prodaddCart_icon.gif" width="16"
height="16" alt="Colocar no carrinho" /></a></div>
</div>
Can anyone tell me what I'm doing wrong here ?
TIA
Grillo
More information about the Javascript
mailing list