var currentmix = document.getElementById('custommix').value.split(",");
var additionalcost = 0;
for (i = 0; i < currentmix.length; i++) {
if (currentmix[i] != "") {
var mixinpriceid = "mixinprice"+currentmix[i];
additionalcost += parseFloat(document.getElementById(mixinpriceid).value));
}
}
This snippet seems to have a bug :(
Despite each iteration providing the correct number through
parseFloat(document.getElementById(mixinpriceid).value)
,
it does not seem to impact the variable "additionalcost" beyond the loop.
Any suggestions on how to address this issue?