PASSING DATA to PHP query using Ajax : how can I pass the input text data in HTML to a PHP function, without clicking the submit button?

I already had the idea to use Ajax to fetch the data from the database, but I only wanted to query a specific row.


[php function to fetch specific row][1]

[html page that automatically fills the input text for contact and address  whenever after input the name of the customer, instantaneously fetch the information of that name from the database][2]


  [1]: https://i.stack.imgur.com/WrFiM.png
  [2]: https://i.stack.imgur.com/x4h6w.png