Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
Cómo usar jquery .each para la suma total de la cantidad x precio = suma total

cómo usar jquery .each para qyt + precio = suma total, estoy usando javascript pero tengo un error si lo lleno con cualquier color y edito la entrada de otro color, total_sum_value incorrecto

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

estoy usando ajax para agregar a la tabla

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!