How to fill the form after select autocomplate?

How to fill the form after select autocomplate?

I have database like below


and my form like below :


form ID  is autocomplate. when i select data from ID form. then name, address and telp will be filled.


  1. <script>
    $(function($) {
    $( "#id").autocomplete({
    source: "search.php",
    minlength: 4,
    width: 512,
    select: function( event, ui ) {
     







  2. // what should i do here........???

  3.     }
    });
    });
    </script>