title: How to get Mysql data in javascript code
body: <p>I have 3 textfields (Product name, product code and company name) in a form. </p>
  
  <p>In the first field after selecting product name from ui auto-complete list I need to automatically populate product code and company name from mysql database.</p>
  
  <p>I've tried the code below but am only successful in getting product name through javascript onKeyUp event. </p>
  
  <pre><code>// java script code
  
  if(obj[i].name == "product_name[]") { var product_name = obj[i].value; }
  if(obj[i].name == "product_code[]") {
    if(product_name) { obj[i].value = product_name; }
         else { obj[i].value = 0; }
   }
  
  // Html code
  &lt;input type="text" name="product_name[]" id="product_name" onKeyUp="getValues()"&gt;
  
  &lt;input type="text" name="product_code[]" id="product_code" onfocus="getValues()"&gt;
  </code></pre>