I have a form which contains a select named Client_ID as well as some other text inputs. What I need is that when a user selects a Client_ID, my fields Address1, Address 2 etc should be populated with the result of a database query along the lines of
SELECT Address1, Address2 from Client where Client_ID = Client_ID
I’m aware this is somewhat of a noob question, but would really appreciate some help on the simplest and best way to do this.
You should do something like this with jQuery + JSON
First of all download jquery from here and include it in your application.
If home.php, your downloaded jquery file(jquery-1.4.2.min.js) and getData.php are in the same folder then your home.php will be look like this:
home.php (file that contain your form)
getData.php
I have tested this code on my machine and it is working.