Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

287
Visualizações
It is not possible to press the submit button in a form in the datatable

When using a datatable and when a form is placed in one of the row, the submit button cannot be pressed, meaning nothing happens when pressing submit button. I checked the datatable files and found that the file vendor.js that contains this code:

let table1 = document.querySelector('#table1');
let dataTable = new simpleDatatables.DataTable(table1);

when remove this code the submit button working well,But the datatable is crashing.. Has anyone faced this problem before or a solution to this problem? my code:

<table class='table table-striped' id="table1" style="text-align:center; font-size:0.8em;">
             <thead >
              <tr>
                <th style="text-align:center;">#</th>
                <th style="text-align:center;">Product name</th>
                <th  style="text-align:center;">Price</th>
                <th  style="text-align:center;">Edit</th>
                <th  style="text-align:center;">Remove</th>
              </tr>
            </thead>
            <tbody>
            <tr>
                <td class="col-sm-5 col-md-5">1</td>
                <td class="col-sm-1 col-md-1" style="text-align: center">   Apple  </td>
                <td class="col-sm-1 col-md-1 text-center">3$</td>
                <td class="col-sm-1 col-md-1 text-center"><form action="Product" method="post"><input class="form-control" step="1" min="1" max="1000" value="<?= $quantity_ordrs; ?>" type="number" name="qty" >
                <input type="hidden" name="order-id" value="1" >
                 <button type="submit" class="btn btn-outline-primary"  name=" update-item"><i class="fa fa-edit"></i>edit</button>
                </form></td>
                <td class="col-sm-2 col-md-2 " >
                <form action="Order?kkk" method="post"><input class="form-control" step="1" min="1" max="1000" value="" type="number" name="qty" ><input type="hidden" name="order-id" value="1" >
                 <button type="submit" class="btn btn-outline-primary"  name="remove-item" ><i class="fa fa-trash"></i>remove</button>
                </form>
                </td>
                  </tr></tbody></table>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Something is preventing the default onsubmit event. You can either find the event listener responsible for blocking your submission, or you can create anew listener:

<button type="button" class="btn btn-outline-primary"  name="update-item"><i class="fa fa-edit"></i>edit</button>
$('[name="update-item"]').on('click', function() {
   $('#myForm').submit();
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda