I am so close to having this mini form “calculator” finished… but I am stummped.
I made a calculator to approximate the specific gravity of Sucrose in a solution at 20 deg. C
Equation: X * 0.00425 + 0.9988 = S.G. of Sucrose
my problem is that this for works, but it only does if you re-type the numbers that are predefined… here is my code… can someone tell me what I am doing wrong - it’s driving me bonkers.
<table width="450" border="0" cellpadding="5" cellspacing="5" summary="A simple calculator to give a close approximation to the equivalent figure for the S.G. of Sucrose at 20 deg. C">
<tr>
<td width="221">Brix Value</td>
<td width="194"><input type="text" id="Field1" /></td>
</tr>
<tr>
<td>Multiplier</td>
<td><input type="text" value="0.00425" id="Field2" /></td>
</tr>
<tr>
<td>Add Factor</td>
<td><input type="text" value="0.9988" id="Field3" /></td>
</tr>
<tr>
<td>S.G. of Sucrose @ 20 deg C.</td>
<td><input type="text" id="Total" /></td>
</tr>
<tr>
<td> </td>
<td><input type="button" value="Calculate S.G." id="btn" onclick="document.getElementById('Total').value=parseInt(document.getElementById('Field1').value)*parseInt(document.getElementById('Field2').value)+parseInt(document.getElementById('Field3').value);" /></td>
</tr>
</table>