title: jquery-ui-1.8.14 Autocomplete with php and mysql
body: <p>I'm not very much into js and programing in general, but I'm very stuck on something that really shouldn't be too difficult. Feel free to visit the test page:</p>
  
  <p>[REMOVED LINK]</p>
  
  <p>I have three autocomplete fields: Current club, nation and career stats.
  Autocomplete works perfectly for the career stats where I can also add fields and the autocomplete also works for the added field.</p>
  
  <p>But for the current club and nation fields, I get results while typing but when I click the correct output it doesn't show up in the input-field.</p>
  
  <p>I can make it work using other js-libraries, but then it no longer work for the add-button career stats fields.</p>
  
  <p>I use the following libraries:</p>
  
  <pre><code>&lt;script  type="text/javascript" src="js/jquery-1.6.3.js"&gt;&lt;/script&gt;
  &lt;script  type="text/javascript" src="js/jquery-ui-1.8.14.custom.min.js"&gt;&lt;/script&gt;
  &lt;script  type="text/javascript" src="js/jq-ac-script.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The current club html looks like:</p>
  
  <pre><code>&lt;p&gt;
      Current club &lt;label&gt;:&lt;/label&gt;
      &lt;input type="text" id="currentclub" /&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>In the custom made jq-ac-script.js (I originally found this somewhere online - don't remember where) the important part is:</p>
  
  <pre><code>$(document).ready(function(){
      $( "#currentclub" ).autocomplete({
          source: "get_club_list.php",
          minLength: 1    
      })
      .data( "autocomplete" )._renderItem = function( ul, item ) {
         return $( "&lt;li&gt;&lt;/li&gt;" )
         .data( "item.autocomplete", item )
         .append( item.currentclub )
         .appendTo( ul );
      };
  });
  </code></pre>
  
  <p>The "get_club_list.php" looks like:</p>
  
  <pre><code>&lt;?php
  include ("dbsetup.php");
  
  $return_arr = array();
  $param = $_GET["term"];
  
  $fetch = mysql_query("SELECT * FROM FootNews_CLUB 
      WHERE clubShortName LIKE '%$param%'");
  
  /* Retrieve and store in array the results of the query.*/
  while ($row = mysql_fetch_array($fetch, MYSQL_ASSOC)) {
  
      $row_array['currentclub']           = $row['clubShortName'];
      array_push( $return_arr, $row_array );
  }
  
  /* Free connection resources. */
  mysql_close($conn);
  
  /* Toss back results as json encoded array. */
  echo json_encode($return_arr);
  
  ?&gt;
  </code></pre>
  
  <p>Any ideas whereas to why the selected club doesn't show up when I click it would be appriciated!!</p>