title: jQuery slider onChange auto submit form
body: <p>I'm using a jQuery slider as a price range selector in a form.
  I'd like to have the form submit automatically when one of the values has been changed. I used a couple of examples I found on SO but they didn't work with my code.</p>
  
  <pre><code>&lt;form action="itemlist.php" method="post" enctype="application/x-www-form-urlencoded" name="priceform" id="priceform" target="_self"&gt;    
    &lt;div id="slider-holder"&gt;
      Prices: From &lt;span id="pricefromlabel"&gt;100 &amp;#8364;&lt;/span&gt; 
                To &lt;span id="pricetolabel"&gt;500 &amp;#8364;&lt;/span&gt;
      &lt;input type="hidden" id="pricefrom" name="pricefrom" value="100" /&gt;
      &lt;input type="hidden" id="priceto" name="priceto" value="500" /&gt;
      &lt;div id="slider-range"&gt;&lt;/div&gt;
      &lt;input name="Search" type="submit" value="Search" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This is the code that displays the values of the slider and updates 2 hidden form fields I use to store the prices in order to submit:</p>
  
  <pre><code>&lt;script&gt;
  
      $(function() {
              $("#slider-range" ).slider({
                  range: true,
                  min: 0,
                  max: 1000,
                  values: [ &lt;?=$minprice?&gt;, &lt;?=$maxprice?&gt; ],
              start: function (event, ui) {
                      event.stopPropagation();
                  },
                  slide: function( event, ui ) {
              $( "#pricefrom" ).val(ui.values[0]);
              $( "#priceto" ).val(ui.values[1]);
              $( "#pricefromlabel" ).html(ui.values[0] + ' &amp;euro;');
              $( "#pricetolabel" ).html(ui.values[1] + ' &amp;euro;');
          }
              });
          return false;
          });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I've tried adding this code as well as an data-autosubmit="true" attribute to the div but no result. </p>
  
  <pre><code>$(function() {
    $('[data-autosubmit="true"]').change(function() {        
      parentForm = $(this).('#priceform');
      clearTimeout(submitTimeout);
      submitTimeout = setTimeout(function() { parentForm.submit() }, 100);        
    });
  </code></pre>
  
  <p>I've also tried adding a $.post() event to the slider but I'm not very good with jQuery so I'm probably doing it wrong. Any help will be appreciated.</p>