Get search results then populate page without refresh


I am not realy sure where to start. I have a page setup to search for members in my admin panel. I am trying to find a way to get search results without refreshing the page when clicking a button. I already have a file that searches the db which is a seperate php file. The page the search box is on is also a php file. I have spent days googling and reading posts on here with little success. All i want is a button that when clicked will search the db for the member name in the search box then populate a list on the same page without refreshing the page. any tips would be much appreciated. this is my searchbox code below.


You should use ajax.

  1. Create your HTML form
  3. Add a click event on your submit button
  5. Call your backend endpoint from javascript
  7. Display the response

Here is an example from w3schools: