title: Need to pass values to a range slider Jquery function at run time
body: <p>I have the following JQuery function about a <code>range slider</code>. It's just working fine.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      jQuery(function() {         
  
          jQuery("#slider-range").slider({
              range: true,            
              min: 55, 
              max: 50000,
              values: [55, 50000],
              slide: function(event, ui) {
                  jQuery("#minValue").val(ui.values[0]);
                  jQuery("#maxValue").val(ui.values[1]);
              }
          });
          jQuery("#minValue").val(jQuery("#slider-range").slider("values", 0));
          jQuery("#maxValue").val(jQuery("#slider-range").slider("values", 1));
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Now, I need to pass the values of <code>max</code> and <code>min</code> within the function dynamically at run time from MySql database that indicate the range of the slider.</p>
  
  <p>I have tried to set those values by using hidden fields something like the following.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      jQuery(function() {         
  
       var mini=document.getElementById("hid_min_price").value;
       var maxi=document.getElementById("hid_max_price").value; 
  
          jQuery("#slider-range").slider({
              range: true,            
              min: mini, 
              max: maxi,
              values: [mini, maxi],
              slide: function(event, ui) {
                  jQuery("#minValue").val(ui.values[0]);
                  jQuery("#maxValue").val(ui.values[1]);
              }
          });
          jQuery("#minValue").val(jQuery("#slider-range").slider("values", 0));
          jQuery("#maxValue").val(jQuery("#slider-range").slider("values", 1));
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>but it isn't working. How can then I set the values of <code>max</code> and <code>min</code> dynamically at run time?</p>