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

85
Vistas
How to post previous Jquery ajax search checkbox with PHP?

I am working on ajax with jquery,Right now I am using jquery "autocomplete" function So after I enter some characters I am getting list of records with checkbox but problem is that "I can't post previous checked checkbox records",Means if I search something and select some check boxes and then do another search and select some checkbox then the previous checked checkbox value is not posting,How can I do this ? I tried with following code but not working correctly (only posting current select/checked records),Where I am wrong ? Thank you in advance

<input type="text" id="autouser" name="coin" class="form-control">
            <div id="resultDiv"></div>
        

<script type='text/javascript'>
    $(document).ready(function(){
    $( "#autouser" ).autocomplete({
         source: function( request, response ) {
          // Fetch data
          $.ajax({
            url:'<?php echo base_url();?>main/CoinReords',
            type: 'post',
            dataType: "json",
            data: {
              search: request.term
            },
            success: function( data ) {
                $("#resultDiv").html("");
                $.each(data, function(i, record) {
                    console.log(record.label);
                $("#resultDiv").append("<input type='checkbox' value='" + record.label + "' id='chk-" + i + "' name='CoinName[]' /> " + record.label);
  });
            }
          });
        },
        select: function (event, ui) {
            $('#autouser').val(ui.item.label); // display the selected text
          $('#resultDiv').selectedItems.push(ui.item.label); 
          return false;
        }
      });

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