How could it be done that I make an Ajax Search after the user typed in 3 characters?
I’m not that expert in javascript, but here’s my HTML file so far:
<form>
<input type="text" id="searchField" name="searchField" placeholder="...">
</form>
<script>
$('#searchField').searchbox({
url: 'components/search_ajax.php',
param: 'q',
dom_id: '#searchResult',
delay: 0,
loading_css: '#spinner'
});
</script>
At the moment the search is called just when the backspace button is pressed (then all of my database entries are represented because there is a match-search with no character).
Thanks in advance!
Regards.
Firstly, you’ll need to let us know which plugin you’re using, I have a feeling it is this, if it is, change:
to
But you should also limit this on your server side, otherwise I can just go directly to your script to view all entries. You can do this at the top of your
phpfile with: