Q:

JqueryUI autocomplete PHP JSON

I'm actually developping an autocomplete for names in my form.
Here is my Jquery code :
$page->appendJs(<<<JS
$(document).ready(function()
{
          $.ajax({
               url: 'jsonClients.php',
               type: 'POST',
               dataType: 'json',
               data: 'client' : $("#client").val(),
               success: function(data){
                     $('#client').autocomplete(
                     {
                           source: data,
                           minLength: 1
                     });
               }
          });
});

JS
);
My input is
<input type='text' id='client' name='client'>

My jsonClients.php is working, it needs a client parameters.
I never made any jquery before, so i'm kinda lost.
EDIT :
Json
$json = array();

while($client = $requete->fetch()) {
    array_push($json, array('nom' => $client['CLI_NOM']));
}

echo json_encode($json);

Thanks for your help

A:

It should be data: {'client' : $("#client").val()} instead of "data: 'client' : $("#client").val()". 
Look at this example. So code which is below should work properly:
$(document).ready(function(){
      $.ajax({
           url: 'jsonClients.php',
           type: 'POST',
           dataType: 'json',
           data: {'client' : $("#client").val()},
           success: function(data){
                 $('#client').autocomplete(
                 {
                       source: data,
                       minLength: 1
                 });
           }
      });
});

