title: Bind Value to textbox
body: <p>In using jQuery Autosuggest, users are able to start entering a part number and autosuggest shows a list of similar parts.  Once a part is select, I want the description to appear in a textbox next to the part number.  The part numbers and description are coming back from the CFC, but I am unable to get the part description to appear in the part description text box.  how can I do this?</p>
  
  <p>The form with jQuery:</p>
  
  <pre><code>&lt;form action="index.cfm?action=reports:part.test"  method="post"&gt;
  &lt;fieldset&gt;
      &lt;legend&gt;test&lt;/legend&gt;
      &lt;p&gt;Start typing a part number.&lt;/p&gt;
      &lt;p&gt;
          &lt;label for="partnum"&gt;Part Number: &lt;/label&gt;
              &lt;input type="text" id="partnum"  name="partnum" /&gt;
              &lt;input readonly="readonly" type="text" id="partdescription" name="partdescription" /&gt;
      &lt;/p&gt;
      &lt;p&gt;
              &lt;input type="submit" name="submit" value="Submit" /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  &lt;/form&gt;
  
  
  &lt;cfsavecontent variable="datatables_definitions"&gt;
  &lt;!-- added by user.list --&gt; 
  &lt;SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"&gt;
  $(document).ready(function(){
  
  
  
          $('#partnum').autocomplete(
              {source: function(request, response) {
                  $.ajax({
                      url: "/reports/services/remote/partSuggest.cfc?method=lookUpPart&amp;returnformat=json",
                      dataType: "json",
                      data: {
                        search: request.term,
                        maxRows: 10
                      },
                      success: function(data) {
                        response(data);
                        $('#partdescription').val(partdescription);
                      },
  
              })
              },
              parse: function(data){
                  return $.map(data, function(item) {
                      return { data: item, value: item, result: item };
                  });
              }
  
          });
      });
  &lt;/SCRIPT&gt;
  &lt;/cfsavecontent&gt;
  
  &lt;cfhtmlhead text="#datatables_definitions#" /&gt;
  </code></pre>
  
  <p>The CFC doing the query:</p>
  
  <pre><code>&lt;cfcomponent output="false"&gt;
      &lt;cffunction name="lookUpPart" access="remote" returntype="any" &gt;
          &lt;cfargument name="search" type="any" required="false" default=""&gt;
          &lt;cfargument name="datasource" type="string" required="no" default="myDSN"&gt;
  
          &lt;!--- Define variables ---&gt;
          &lt;cfset var data=""&gt;
          &lt;cfset var result=ArrayNew(1)&gt;
  
          &lt;!--- Do search ---&gt;
          &lt;cfquery name="getPart" datasource="#arguments.datasource#"&gt;
              SELECT top 20 partnum, partdescription
              FROM part
              WHERE partnum LIKE '%#trim(arguments.search)#%'
              ORDER BY partnum
          &lt;/cfquery&gt;
  
          &lt;!--- Build result array ---&gt;
          &lt;cfloop query="getPart"&gt;
              &lt;cfset returnStruct = StructNew() /&gt;
              &lt;cfset returnStruct["partnum"] = partnum /&gt;
              &lt;cfset returnStruct["partdescription"] = partdescription /&gt;
              &lt;cfset ArrayAppend(result,returnStruct) /&gt;
          &lt;/cfloop&gt;
  
          &lt;!--- And return it ---&gt;
          &lt;cfreturn serializeJSON(result) /&gt;
      &lt;/cffunction&gt;
  &lt;/cfcomponent&gt;
  </code></pre>
  
  <p>Again, once the user successfully selects a part number from the list, I want the associated part description to appear in the partdescription box next to the part number.</p>
  
  <p>Thanks.</p>