title: jQuery - Change dropdown value and submit form
body: <p>I have a page with a dropdown where the default value is <strong>Availability</strong>. I would like to change this value with jQuery to be <strong>Newest</strong>. The problem I'm having is it needs to do a postback where basically the page refresh to show content from the selected option. Any clue guys? I don't have to the source and neither the backend, all I'm able to do is manipulating with jQuery.</p>
  
  <p>This what I have tried but it goes in an infinite loop, the page keeps reloading for ever.</p>
  
  <pre><code>$('select[name="ctl00$mainContentPlaceHolder$ListProducts$ListSort"]').val('CustomSortExpression').closest('form').submit();
  </code></pre>
  
  <p>Thanks</p>
  
  <pre><code>&lt;select style="width:140px;" id="ctl00_mainContentPlaceHolder_ListProducts_ListSort" onchange="javascript:setTimeout('__doPostBack(\'ctl00$mainContentPlaceHolder$ListProducts$ListSort\',\'\')', 0)" name="ctl00$mainContentPlaceHolder$ListProducts$ListSort"&gt;
   &lt;option value="CustomSortExpression"&gt;Newest&lt;/option&gt;
   &lt;option value="Availability"&gt;Availability&lt;/option&gt;
   &lt;option value="Alphabetical" selected="selected"&gt;Alphabetical (A-Z)&lt;/option&gt;
   &lt;option value="Brand"&gt;Brand Name (A-Z)&lt;/option&gt;
   &lt;option value="PriceHighestToLowest"&gt;Price (Highest to Lowest)&lt;/option&gt;
   &lt;option value="PriceLowestToHighest"&gt;Price (Lowest to Highest)&lt;/option&gt;
   &lt;option value="RecommendedProducts"&gt;Recommended&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>