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

115
Views
Agregue una fila al formulario con append (), pero cuando se envía, no incluye los datos de las filas adjuntas

Intentar crear un formulario que pueda tener filas agregadas cuando se necesitan filas adicionales y enviar el formulario a una base de datos con php y jquery. Puedo agregar las filas, pero cuando se envía el formulario, se omiten de la respuesta. ¿Alguien puede aclarar qué está mal?

codigo para formulario

 <table class="material-form"> <thead> <tr style="display: flex; flex-direction: row; justify-content: space-around;"> <th>Sku</th> <th>Description</th> <th>Order</th> </tr> </thead> <?php $attributes = array('name' => 'count_form'); echo form_open_multipart('request/C_request/new_material_request?wh=' . strtolower($warehouse['warehouse_name']) , $attributes); ?> <div > <tbody style="display: flex; flex-direction: column;"> <tr id="rows"> <td><input type="textarea" id="sku" name="sku[]" onblur="sumFunction()" style="font-size: 30px; background-color: #DCDCDC; height: 80%; margin-right: 15px" class="col-md-4" ></td> <td><input type="textarea" id="sku" name="sku[]" onblur="sumFunction()" style="font-size: 30px; background-color: #DCDCDC; height: 80%; margin-right: 15px" class="col-md-4" ></td> </tr> </tbody> </div> </table> <div id="add-row" >add row<p id="counter"></p></div> <button type="button" class="btn btn-primary btn-lg" id="accept-count" style="">submit</button>

código para enviar

 jQuery(document).ready(function ($) { $('#add-row').click(function() { $('#rows').prepend('<td><input type="textarea" id="sku" name="sku[]" onblur="sumFunction()" style="font-size: 30px; background-color: #DCDCDC; height: 80%; margin-right: 15px" class="col-md-4" ></td>' ) }) $('#accept-count').click(function () { document.count_form.submit(); }); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tienes HTML no válido. El navegador intenta averiguar lo que está haciendo y lo representa. No puede tener un elemento form y div como elemento secundario de una tabla. Su html debería verse como

 <form> <table> <thead> </thead> <tbody> </tbody> </table> </form>

Ahora, por la forma en que estás jugando con el css y usando flex, no estoy seguro de por qué estás usando una tabla.

about 4 years ago · Juan Pablo Isaza Report
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!