title: Update the value of a field while typing on another field
body: <p>I would like the field amount to be updated while the user is typing in the field km. I used the <strong>.change</strong> but the field is only updated when the field loses focus, like the onfocusout event.  What coudl I try in order to archive my request?</p>
  
  <p><a href="https://jsfiddle.net/yUhtj/" rel="nofollow">https://jsfiddle.net/yUhtj/</a></p>
  
  <pre><code>&lt;label&gt;Expense&lt;/label&gt;
      &lt;select id="ExpenseTypeId" name="ExpenseTypeId"&gt;
          &lt;option value=""&gt;&lt;/option&gt;
          &lt;option value="1"&gt;Avance sur frais&lt;/option&gt;
          &lt;option value="2"&gt;Carburant voiture societ&amp;#233;&lt;/option&gt;
          &lt;option value="3"&gt;Frais kilom&amp;#233;triques&lt;/option&gt;
      &lt;/select&gt;
      &lt;label id="kmtxt" class="hidden"&gt;Distance (the amount will be automatically calculated&lt;/label&gt;
      &lt;input type='text' id="km" class="hidden"/&gt;
      &lt;label id="amounttxt" &gt;Amount&lt;/label&gt;
      &lt;input type='text' id="amount" /&gt;
  
  &lt;script&gt;
      $('#ExpenseTypeId').change(function(){
          var selected_item = $(this).val()
          if(selected_item == "3"){
              $('#kmtxt').val("").removeClass('hidden');
              $('#km').val("").removeClass('hidden');
              $('#amount').prop('readonly', true);
          }else{
              $('#kmtxt').val(selected_item).addClass('hidden');
              $('#km').val(selected_item).addClass('hidden');
          }
      });    
  
      $("#km").change(function () {
  
          var price = Number($(this).val());
          var total = (price) * 0.25;
          $("#amount").val(total);
      });
  &lt;/script&gt;
  </code></pre>