I have this Javascript code. The addition line doesnt add. It concats. For example, i have 2 values: 100.00 and 10.00 . It comes out as 10.00100.00
I googled and "+" is the right thing to use. Not sure why it's not adding:
<script type="text/javascript">
var amount = 0.00;
function prices(price) {
var tempAmount = document.getElementById('<%=x_amount.ClientID %>');
alert(tempAmount.value);
amount = price + tempAmount.value;
alert(amount);
tempAmount.value = amount;
// alert(amount.value);
}
</script>
Open in new window
Open in new window
http://www.w3schools.com/jsref/jsref_parsefloat.asp