Could someone help me to see where my goof-up is?
I'm don't use javascript regularly enough to know it well enough, so any help would be great! This basically seems to run fine on InternetExplorer, but not on Google Chrome.
When I cut it back to single line of adding two numbers, it works fine on google chrome browser. But once everything is in it, it doesn't update any of the form fields.
here is my code:
I'm don't use javascript regularly enough to know it well enough, so any help would be great! This basically seems to run fine on InternetExplorer, but not on Google Chrome.
When I cut it back to single line of adding two numbers, it works fine on google chrome browser. But once everything is in it, it doesn't update any of the form fields.
here is my code:
Code:
<script language="javascript">
function addNumbers() {
var val1 = parseInt(document.getElementById("StockQty").value);
var val2 = parseInt(document.getElementById("SOQty").value);
var val3 = parseInt(document.getElementById("EnrouteQty").value);
var val4 = parseInt(document.getElementById("ProductionQty").value);
var ansD = document.getElementById("AvailableQty");
var ansF = document.getElementById("TotalExpectedQty");
var val11 = parseInt(document.getElementById("Month1SalesForecastQty").value);
var val12 = parseInt(document.getElementById("Month2SalesForecastQty").value);
var val13 = parseInt(document.getElementById("Month3SalesForecastQty").value);
var val14 = parseInt(document.getElementById("Month4SalesForecastQty").value);
var val15 = parseInt(document.getElementById("NotallocatedStockQty").value);
var val16 = parseInt(document.getElementById("TotalExpectedQty").value);
var val11 = parseInt(document.getElementById("Month1SalesForecastQty").value);
var val12 = parseInt(document.getElementById("Month2SalesForecastQty").value);
var val13 = parseInt(document.getElementById("Month3SalesForecastQty").value);
var val14 = parseInt(document.getElementById("Month4SalesForecastQty").value);
var ansG = document.getElementById("Month1ForecastedRequirementQty");
var ansH = document.getElementById("Month2ForecastedRequirementQty");
var ansI = document.getElementById("Month3ForecastedRequirementQty");
var ansJ = document.getElementById("Month4ForecastedRequirementQty");
ansD.value = val1 - val2;
ansF.value = val1 - val2 + val3 + val4;
ansG.value = val15 - val16 + val11;
ansH.value = val15 - val16 + val11 + val12 - ansG.value;
ansI.value = val15 - val16 + val11 + val12 + val13 - ansH.value - ansG.value;
ansJ.value = val15 - val16 + val11 + val12 + val13 + val14 - ansI.value - ansH.value - ansG.value;
}
</script>