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

131
Vistas
How can i keep the checkboxes checked after reload ajax data (Change the search details)

I have a table that loads from another page by ajax, and a dynamic search field the loaded data change on update on the search field. And I have a large list of checkboxes, when I check the box and change search text the checked boxes are unchecked, how can I keep it checked ?

Checkboxes:

while($row = mysqli_fetch_array($result))

 {
  echo'<tr><td><label class="list-group-item">
  <input name="checkbox[]" id="checkbox[]" class="form-check-input me-1" type="checkbox" value="'.$row["ID"].'"></td>
  <td>
  ';}

Ajax:

<script>
$(document).ready(function(){

load_data();

function load_data(query)
{
 $.ajax({
  url:"DeleteGroup_Fetch.php",
  method:"POST",
  data:{query:query},
  success:function(data)
  {
   $('#result').html(data);
  }
 });
}
$('#search_text').keyup(function(){
 var search = $(this).val();
 if(search != '')
 {
  load_data(search);
 }
 else
 {
  load_data();
 }
});
});

</script>

`

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