title: JQuery UI slider setting multiple input values
body: <p>I am trying to get multiple values to change while sliding the JQuery UI slider. Basically changing 3 different values based on the slider's number. 
  In this case I'm using a range of $100,000 to $2,000,000.  Then I want to calculate 3 different values depending on the position of the slider.<br>
  For the first value I want to get 6% - (2.7%+ $2799).
  The second value would be 6% - $5299.
  And the third value would be 6% - $3799
  This is what I have so far:</p>
  
  <pre><code>&lt;div id="slider"&gt;
  &lt;div id="slider-min"&gt;$100,000&lt;/div&gt;
  &lt;div id="slider-max"&gt;$2,000,000&lt;/div&gt;
  &lt;/div&gt;
  &lt;input id="amount" readonly type="text"&gt;
  &lt;div class="options-wrap"&gt;
  &lt;input id="result1" readonly type="text"&gt;
  &lt;input id="result2" readonly type="text"&gt;
  &lt;input id="result3" readonly type="text"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS</p>
  
  <pre><code>$(function() {
  $( "#slider" ).slider({
    range: 'min',
    value: 100000,
    min: 100000,
    max: 2000000,
  slide: function( event, ui ) {
     $( "#amount" ).val( "$" + addCommas(ui.value.toString()));
    }
  });
  $('#amount')
  .val( "$" + addCommas($("#slider").slider("value")));
  ///  Need to add a function(s) that would change the values of
  ///  the following selectors $('#result1'),$('result2') and $('result3')
  ///  based on the position of the slider with the calculation stated above.
  function addCommas(nStr)
  {
  nStr += '';
  x = nStr.split('.');
  x1 = x[0];
  x2 = x.length &gt; 1 ? '.' + x[1] : '';
  var rgx = /(\d+)(\d{3})/;
  while (rgx.test(x1)) {
      x1 = x1.replace(rgx, '$1' + ',' + '$2');
  }
  return x1 + x2;
  }
  });
  </code></pre>
  
  <p>I have tried different ways to get those 3 values to change while sliding the slider, but I've frustratingly failed on every attempt.  I gotta admit I'm no expert and I greatly respect those who have better knowledge on this field.  Any help would be immensely appreciated.</p>