Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

152
Vistas
How to using jquery .each for total sum for the qty x price = sum total

how to using jquery .each for qyt + price = sum total , im using javascript but have a bug if i fill with any colom and i edit input antoher colom, total_sum_value wrong

<script>
function sum(x) {
    var qty = $("#product_qty" + x).val();
    var price = $("#p_price" + x).val();
    var productx = 0;

    if (qty == "") {
        $("#product_qty").val("");
        // alert('Qty Request');
    } else {
        var product_tot = parseInt(qty) * parseInt(price);
        document.getElementById("product_tot" + x).value = product_tot;

        for (let i = 1; i <= x; i++) {  
            var totalhit = $("#product_tot" + i).val();       
            productx = parseInt(productx) + parseInt(totalhit);
        }
        document.getElementById("total_sum_value").value = productx;
    }
}

im using ajax for append for the table

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda