I have an array that I add items to.
everything works if I add values but a need to add a variable value and it keeps saying NAN.
Below my code:
Code:
<script type="text/javascript">
	var cs = parseFloat(document.getElementsByName("target_value")[0].value) * 595;
</script>
This works:
Code:
onclick="simpleCart.add('name=Swanniebraai Complete','price=595', 'dollar=61');return false;"
the problem is that the dollar value must change according to the exchange rate, I have a input box named target_value which holds the exchange rate value.
I have tried the following:
Code:
onclick="cart.add('name=Swanniebraai Complete','price=595', 'dollar=<script>parseFloat(document.getElementsByName(\'target_value\')[0].value)</script>');return false;"
and
Code:
onclick="cart.add('name=Swanniebraai Complete','price=595', 'dollar=cs'"
and
Code:
onclick="cart.add('name=Swanniebraai Complete','price=595', 'dollar=<script>cs</script>'"
Please help urgently. Please please please.