Non riesco a capire dove sbaglio. Il risultato del calcolo non mi viene bene!
Qualcuno mi puà aiutare?
<head>
<title>The calculation of the maximum gullet width of cutter</title>
</head>
</html>
<form id="form1" name="form1" method="post" action=""
onsubmit="return calcola();">
<p>
<label>Input the cutter diameter D (mm) </label>
<br>
<br>
<input name="diameter" id="q1" maxlength="3" type="number" size="40" td align="left" border="1" value="" />
</p>
<p>
<input type="submit" value="calculate" />
<input type="reset" value="reset" />
<BR>
<br>
<label>The maximum gullet width (mm)</label>
<br>
<br>
<input type="text" name="totale" id="totale" size="40" $dec="0" td align="left" value="" />
</p>
</form>
<script type="text/javascript">
function calcola() {
var q1 = parseFloat(document.getElementById('q1').value);
if (q1 >= 16 && q1 < 80) {
document.getElementById('totale').value = (q1 * 0,235 + 7,2);
}
else if (q1 > = 80 && q1 < 250) {
document.getElementById('totale').value = (q1 * 0,1 + 18);
}
else {
document.getElementById('totale').value = (q1 * 0 + 43);
}
return false;
}
</script>
Qualcuno mi puà aiutare?
<head>
<title>The calculation of the maximum gullet width of cutter</title>
</head>
</html>
<form id="form1" name="form1" method="post" action=""
onsubmit="return calcola();">
<p>
<label>Input the cutter diameter D (mm) </label>
<br>
<br>
<input name="diameter" id="q1" maxlength="3" type="number" size="40" td align="left" border="1" value="" />
</p>
<p>
<input type="submit" value="calculate" />
<input type="reset" value="reset" />
<BR>
<br>
<label>The maximum gullet width (mm)</label>
<br>
<br>
<input type="text" name="totale" id="totale" size="40" $dec="0" td align="left" value="" />
</p>
</form>
<script type="text/javascript">
function calcola() {
var q1 = parseFloat(document.getElementById('q1').value);
if (q1 >= 16 && q1 < 80) {
document.getElementById('totale').value = (q1 * 0,235 + 7,2);
}
else if (q1 > = 80 && q1 < 250) {
document.getElementById('totale').value = (q1 * 0,1 + 18);
}
else {
document.getElementById('totale').value = (q1 * 0 + 43);
}
return false;
}
</script>