[Solved] php ajax autocomplete form mysql database
[ad_1] Put this between <HEAD> and </HEAD> put this: <script src=”https://stackoverflow.com/questions/21204158/jquery-2.0.2.js”></script> <script> $.customPOST = function(data,callback){ $.post(‘search.php’,data,callback,’json’); } $(document).ready(function() { $(“.search”).keyup(function(){ $.customPOST({search: $.(‘#searchid’).val(),function(response){ if(response.success){ var html_code=”<div class=”show” style=”text-align:left;”>”; html_code += ‘<span class=”name”>’ + response.final_username + ‘</span>’; html_code += ‘ <br/>’ + response.final_email + ‘<br/></div>’; $(“#result”).text(html_code); $(“#result”).show(); } }); }); </script> You PHP script must return a JSON … Read more