<h4>Both Product fix price. if checkbox is check and chose quantity automaticaly total</h4> <p class="one">Product
Quantity</p> <div class = "checkbox"> <input type="checkbox" name="abim[]" id="tab_price" value="100" onkeyup="AutoCalc(this)">Samsung TV
<input type="number" id="tab_quantity" value="0" onkeyup="AutoCalc(this)"><br/> <input type="checkbox" id="mineral_price" name="abim[]" value="200" onkeyup="AutoCalc(this)">SonyVaio TV
<input type="number" id="mineral_qunatity" value="0" onkeyup="AutoCalc(this)"><br/><br/>
Total
<input type="text" id="total" disabled><br/> </div> <script>
function AutoCalc() {
var tab_price= 100;
var mineral_price= 200;
var tab_quantity = parseInt(document.getElementById('tab_quantity').value);
var mineral_qunatity = parseInt(document.getElementById('mineral_qunatity').value);
var tota = tab_quantity * tab_price;
var totag = mineral_qunatity * mineral_price;
var allTotal = totalTab + totalAt
if (isNaN(totalTab))
{
document.getElementById('total').value = "waiting..";
}
document.getElementById('total').value = allTotal;
}
</script>