JS form element and math
Adding number to value of check box on click and alerting
by Oliver Kelso
HTML
<form>
<tr>
<th>AMMENITIES INCLUDED </th>
<td><input type="checkbox" name="Ammenities" id="test" value='10000' /></td>
<td> </td>
<td> </td><th> Php 10,000 </th>
</tr>
</form>
JavaScript
document.getElementById('test').onchange = function AmmenitiesCALC(value) {
if ( this.checked === true ) {
value = this.value;
newValue = parseInt(value);
alert(newValue);
document.formcheck.Total.value = newValue;
Total+=newValue;
document.formcheck.Total.value = Total;
}
};