title: using selectfield value to lookup json table
body: <p>For different quantities, the unit price changes. I have a quantity dropdown box, a span for unit price, subtotal and total.</p>
  
  <p>I want to make it so that when the dropdown box is changed, the unit price will updated, then subtotal will be updated, then the total price will be updated. So far I am using:</p>
  
  <pre><code>$('#quantity').change( function() {
      var pricetable = {
          "1": "368",
          "3": "338",
          "6": "298"
      }
  
      $('#unitprice').text(pricetable.$('#quantity').val());
      $('#subtotal').text($('#unitprice').val() * $('#quantity').val());
      subtotalsum();
  });
  </code></pre>
  
  <p>I know that <code>pricetable.$('#quantity').val()</code> is wrong, but don't know how to use <code>$('#quantity').val()</code> to lookup the JSON price table.</p>
  
  <p>Thanks in advance</p>