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

76
Visualizações
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 à 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