This might be tough for me to explain but imagine I have two boxes, boxA is 1 ft by 10 ft and boxB is 1 ft by 5 ft. boxB sits inside boxA (if boxB exists) so if one box is full and the other isn't then total = 5. If boxB doesn't exist then total = 10 (or 0). If both boxes are full, total = 10. Here's the code (always returns zero).
var boxA_value = +document.getElementById("boxA_value").value || 0;
var boxB_lenght = +document.getElementById("boxB_length").value || 0;
var boxB_value = +document.getElementById("boxB_value").value || 0;
if (boxA_value = 0) {
var totalValue = boxB_value;
}
else {
totalValue = (boxA_value - boxB_length) + boxB_value;
}
This would work if I could find out what I'm doing wrong.