Here's what I am trying to achieve.
Have a bit of code, Javascript
<script type="text/javascript"><!--
function updatesum() {
document.alkalinity2.sum.value = (document.alkalinity2.sum2.value -0) - (document.alkalinity1.sum1.value -0);
document.alkalinity3.sum2.value = (document.alkalinity2.sum.value) / (10) * (0.075) * (1.5) * (16);
document.alkalinity4.sum3.value = (document.alkalinity3.sum2.value) / (16);
document.calcium2.sum.value = (document.calcium2.sum2.value -0) - (document.calcium1.sum1.value -0);
document.calcium3.sum2.value = (document.calcium2.sum.value) / (10) * (0.075) * (1.25) * (16);
document.calcium4.sum3.value = (document.calcium3.sum2.value) / (16);
document.chlorine2.fchl.value = (document.chlorine1.r0871.value -0) * (0.2);
document.chlorine4.cchl.value = (document.chlorine3.r0003.value -0) * (0.2);
document.chlorine5.breakpoint.value = (document.chlorine4.cchl.value) * (10);
document.chlorine6.shockoz.value = (document.chlorine5.breakpoint.value) * (13.0) * (0.075);
document.chlorine7.shockgal.value = (document.chlorine6.shockoz.value) / (128);
document.chlorine9.change.value = (document.chlorine8.needs.value -0) - (document.chlorine2.fchl.value);
document.chlorine10.addoz.value = (document.chlorine9.change.value) * (13.0) * (0.075);
}
//--></script>
Then I also have a database table:
Pool_config - Selected_Month
I have a drop down with radio buttons that will change the selected month.
In this database table is one of the following depending on the Radios and drop down:
January_Whirl
February_Whirl Through December
Or
January_Pool
February_Pool thorough December.
Is there a way I can change the javascript depending on if the "Selected_Month" was Whirl or Pool ?
Basically if the Selected_Month was anymonthWhirl The javascript would remain the same. But if the Selected_Month was anymonthPool the (0.075) in the java would change to (1.13)
Any help would be great.