Below is my code, I have two problems.
1. I would like to remove the E with the box from the webscreen. Is there a way to do this without messing up the calculations?
2. Would like question 2 and the answer to have a , . Example want 100,000 and not 100000.
<html>
<head>
<script type="text/javascript">
function CalculateSum(form)
{
Atext=form.input_A.value;
Btext=form.input_B.value;
Ctext=form.input_C.value;
Dtext=form.input_D.value;
Etext=form.input_E.value;
var A = parseFloat(Atext);
var B = parseFloat(Btext);
var C = parseFloat(Ctext);
var D = parseFloat(Dtext);
var E =parseFloat(Etext);
if(E<300)
form.Answer_for_E.value="Jugs";
else
if((E>=300) && (E<800))
form.Answer_for_E.value="Drums";
else
if((E>=800) && (E<6601))
form.Answer_for_E.value="IBC";
else
form.Answer_for_E.value="Bulk";
form.Answer.value = (A * B / C * D);
}
</script>
</head>
<body>
<form name="Calculator" method="post">
<p>Enter the number of SCR trucks you operate: <input type=text name="input_A" size=10></p>
<p>Enter the average miles for a single truck, traveled in one year (default is 100,000 miles p.a.): <input type='text' name="input_B" size='10' value='100000'></p>
<p>Enter the average fuel mileage of your trucks (measured as MPG, defaults is 6 MPG): <input type='text' name="input_C" size='10' value='6'></p>
<P style="margin-top: 0; margin-bottom: 0">Default dosage rate is 2% DEF per every gallon of diesel fuel based on engine manufactures: <input type='text' name="input_D" size='10' value=.02></p>
<p style="margin-top: 0; margin-bottom: 0">
(Please enter percent as a decimal. ie 2% is entered as .02) </p>
<p>E<INPUT TYPE=TEXT NAME="input_E" SIZE=10>
<P><INPUT TYPE="button" VALUE="Average yearly gallons of DEF you may consume:" name="AddButton" onClick="CalculateSum(this.form)">
<input name='Answer' type=text value"gallons comsumed" size="20">
<p>Recommended form of package to be used when ordering DEF:
<input name='Answer_for_E' type=text value"here will be the answer for E" size="20">
<P><INPUT TYPE="reset" VALUE="Clear Fields" name="ClearButton"></P>
</FORM>
</BODY>
</HTML>