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

127
Views
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
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!