Right, I’m trying to add a checkbox that will return a value of 1 when unchecked and a value of 1.05 if checked, any ideas? Here’s the form it’s going in!
[CODE]<form name=”floorcalculator”>
<table>
<tr><td>
Sqm:
</td><td>
<input type=”text” name=”sqm” size=”5″ value =”0″> <input type=”checkbox” name=”wasteage”> Include 5% wasteage
</td></tr>
</table>
<input type=”button” name=”b1″ value=”Calculate” onClick=calculate()><input type=”reset” /><br><br>
You will need <input type=”text” name=”quantityneeded” size=”3″ value =”0″> packs.<br><font color=”#509950″><b><i>Enter this quantity below if you wish to purchase.</i></b></font>
</form>
<script type=”text/javascript”>
function calculate() {
var A = document.floorcalculator.sqm.value
var B = document.floorcalculator.wasteage.value
var C = Math.ceil ((A*B)/2.5)
document.floorcalculator.quantityneeded.value = C
}
</script>
Massive thanks to anyone who can help!