In the slider, I am showing invoices. Through JS automatic calculation is done like total price calculation. In the view invoice blade file it is working fine but in the send all invoices preview page the calculation is not working properly. It is getting all the class selector. Is there any way only visible class e will be accessed instead of getting all the price class selector?
here is the JS for total price calculation
function update_total()
{
var sum = 0;
$('.price').each(function(){
var price = $(this).val();
if(price != ''){
sum = parseFloat(sum)+parseFloat(price);
}
});
$('.late_price').each(function(){
var x = $(this).val();
if(x != ''){
sum = parseFloat(sum)+parseFloat(x);
}
});
$('.lost_price').each(function(){
var y = $(this).val();
if(y != ''){
sum = parseFloat(sum)+parseFloat(y);
}
});
$('#subtotal_price').val(sum);
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire