-2
How do I return the query result in a div
<script>
jQuery('document').ready(function() {
  jQuery('#submit').click(function() {
    var dados = jQuery(this).serialize();
    //aqui voce pega o conteudo do atributo action do form
    var url = $(this).attr('action');
    jQuery.ajax({
      type: "POST",
      url: "busca.php",
      data: dados,
      success: function(response) {
        //'response' é a resposta do servidor
        //alert(response);
         $("#div_delect").load("busca.php");
      }
    });
    return false;
  });
});
</script>
<div id="div_delect"></div>
Instead of $("#div_delect"). load("search.php"), put $("#div_delect"). html(Response);
– Sam
I tried that friend, but now I click on search and does not return anything and I test straight without the normal ajax ta
– Rafael
in the search page.php I get the results with $_POST["search"]
– Rafael
The #Ubmit element called the click event, and you did jQuery(this). serialize(). What’s in #Ubmit that you’re Serializing? The tb error is in this. Probably #Submit is a button and you are Serializing the button instead of the form.
– Sam
Got a friend Thank you very much!
– Rafael