OK, I appologise in advance if this post is long, but I need this answer, as I'm at my wits end.
So I have this code
Code:
function SizeSelect(){
if(document.getElementById("JarSize").value=="Small")
document.getElementById("JarPrice").innerHTML="3.00"
else if(document.getElementById("JarSize").value=="Medium")
document.getElementById("JarPrice").innerHTML="5.00"
else if(document.getElementById("JarSize").value=="Large")
document.getElementById("JarPrice").innerHTML="7.00"
}
Which alters the value of JarPrice, based on which JarSize is selected. Which is the code below here.
Code:
<select id="JarSize" onchange="SizeSelect();">
<option value="Small" >Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
</select>
<span class="price">$<span id="JarPrice">3.00</span></span></div>
Now for the hard part. I need this piece of code
Code:
<a href="javascript:;" onclick="simpleCart.add('name=Mango and Papaya', 'price=5', 'quantity=1');" class="prod_buy">add to cart</a>
to be flexible, so that what ever value JarPrice becomes, that 'price=5' becomes the same.
Now, the first piece of code is in a seperate .js file to the other two parts, which sit inside a regular HTML page. As I said, I'm desperate, as this is the only part of my site that isn't working ATM
And if you need more information about any part, please don't hesitate to ask, as I will be able to give as much info as I can.