Auto complete fields if a user is found help

Hi,
I have a Patient intake form which takes Patient information like FIRSTNAME, LASTNAME, DATE OF BIRTH, ADDRESS, CITY, and POSTAL CODE.

When a user enters FIRSTNAME, LASTNAME and DATE OF BIRTH it should fill the rest of the fields (ADDRESS, CITY, POSTAL CODE) if I have a record in my database.

I am using JAVA with MYSQL and I pull records when a user leaves DATE OF BIRTH textbox.

I don’t know weather I should store everything in a dropdown or I should have a separate form for the matched records from where the user can click the record and fill the rest of the fields.

Please note I have to achieve all this using JAVASCRIPT.

Any ideas, suggestions or samples?

Thanks

Thank you for the reply. I figured it out.

Thank you for your post but I just want to make it clear that I will pull the data using JSP and MYSQL after onchange dateofbirth and I will have the matched records I just want to fill the rest of the fields if user selects a record using JavaScript.

You will want to use Ajax techniques to communicate with server-side code to retrieve the appropriate info.

There is a book called Bulletproof Ajax that has very good instructions on how to achieve this, along with the [url=“http://bulletproofajax.com/code/”]code from the book which lets you see things in action.

If the client-side script already has the data, then we can help you to do that.

In order for us to help, we need to know two things.

  1. Where the data is contained.
  2. The HTML fields that you want to fill.