title: How to get selected product's price and show it on table?
body: <p>so the requirement is to have a table which allows the user to create a new estimate online. I went as far as adding rows/ deleting them, having my DB's product list on the product field. But once I select the product, I would like the field 'Price' to pull up its price. </p>
  
  <p>Here's the code I am currently using:</p>
  
  <p></p>
  
  <pre><code>&lt;INPUT type="button" value="Add Row" onclick="addRow('dataTable')" /&gt;
  
  &lt;INPUT type="button" value="Delete Row" onclick="deleteRow('dataTable')" /&gt;
  
  &lt;TABLE id="dataTable" width="350px" border="1"&gt;
      &lt;TR&gt;
          &lt;TD&gt;&lt;INPUT type="checkbox" name="chk"/&gt;&lt;/TD&gt;
          &lt;TD&gt;&lt;INPUT type="text" name="txt"/&gt;&lt;/TD&gt;
          &lt;TD&gt;
              &lt;SELECT name="country" onchange="getPrice(this.value, this.closest('tr').rowIndex);"&gt;
                  &lt;?php while($row = mysql_fetch_array($query)) { 
  
                  echo '&lt;option value="' .$row['nom'] . '"&gt;'.$row['nom'].'&lt;/option&gt;'; }
  
                  ?&gt;
  
  
              &lt;/SELECT&gt;
          &lt;/TD&gt;
  
          &lt;TD&gt;&lt;INPUT type="text" name="txt"/&gt;&lt;/TD&gt;
  
  
      &lt;/TR&gt;
  &lt;/TABLE&gt;
  </code></pre>
  
  <p></p>