samedi 30 mai 2020

Access only visible class selector which is showing in the slider. Currently getting all the class element

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);
   }


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3clWRUm
via IFTTT

Aucun commentaire:

Enregistrer un commentaire