AutoComplete a Field & AutoFill a Form (Php/Mysql)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Pazeh
    New Member
    • Sep 2008
    • 1

    AutoComplete a Field & AutoFill a Form (Php/Mysql)

    Hello, a first timer here! stumbled upon one of the threads hear while searching on google & the feedback was awesome so I decided to jump in & ask my Q! I'm a newbie in AJAX, but I know my way pretty well in PHP / MySQL.

    What is the best/easiest practice that you have used to autocomplete a field & autofill a form?

    Here is the senario.

    I have a MySql table with contacts details, I want that when I start filling the name of the contact in the field, I do get suggestions (autocomplete) & when I choose a suggestion, blur out of the field or press tab the other fields of the form be filled (tel, address, email....) without loading the page.

    Any suggestion / tutorial / directions are welcomed

    thanks in advance!
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    You can use Ajax for both. When the user starts typing, you can use the onkeyup event to make the request for the autocomplete. For the auto-fill either use onchange or onblur. Here's an example of an autocomplete script.

    Comment

    Working...