I am trying to use the hook_form_alter to change the option that is selected by default within a select pull-down when the page loads.  I am able to adjust the order of the options before the page loads but changing the #default_value option does not change the actual selected option when the page loads.  Note function <i>product_type_form_alter </i>below:<br>
<br><i>function product_type_form_alter(&amp;$form, &amp;$form_state, $form_id) {<br>  if ($form_id == &#39;views_exposed_form&#39;) {<br>    $form[&#39;term_node_tid_depth&#39;][&#39;#default_value&#39;] = 184;<b>//this did not work</b><br>
    $form[&#39;term_node_tid_depth&#39;][&#39;#options&#39;] = Array(193 =&gt; &quot;Alpena County&quot;, 184 =&gt; &quot;Genesee County&quot;, 190 =&gt; &quot;Montmorency County&quot;, 186 =&gt; &quot;Oceana County&quot;, 204 =&gt; &quot;Wabasha County&quot;, &quot;All&quot; =&gt; &quot;&lt;Any&gt;&quot;);<b>//this worked</b><br>
    $form[&#39;term_node_tid_depth&#39;][&#39;#default_value&#39;] = 184;<b>//this did not work</b><br>    dd($form[&#39;term_node_tid_depth&#39;][&#39;#default_value&#39;]);<b>//the outputted log value is correctly as 184 but when the page loads it uses the original default of &quot;All&quot;</b><br>
  }<br>}</i><br><br>If I instead include a javascript file within hook_form_alter (<b><i>listed below</i></b>) then I am able to change the actual selected option after the page loads and programmatically click the submit button to rerun the filter, but this is needless processing that causes the page to load twice.  How can I use the method above to change the actual selected option before the page loads?<br>
<br>Thanks,<br><br>John<br><br><i>function product_type_form_alter(&amp;$form, &amp;$form_state, $form_id) {/<b>/this worked completely<br>  </b>if ($form_id == &#39;views_exposed_form&#39;) {<br>    $term_node_tid_depth_get = $_GET[&#39;term_node_tid_depth&#39;];<br>
    if (!isset($term_node_tid_depth_get)) {<br>      drupal_add_js(drupal_get_path(&#39;module&#39;, &#39;product_type&#39;) . &#39;/js/subscription_product_filter.js&#39;,&#39;module&#39;,&#39;footer&#39;);<br>    }<br>  }<br>
<br>&#39;/js/subscription_product_filter.js&#39; contents below:<br>jQuery(&quot;select#edit-term-node-tid-depth option[selected]&quot;).removeAttr(&quot;selected&quot;);<br>jQuery(&quot;select#edit-term-node-tid-depth option[value=&#39;184&#39;]&quot;).attr(&quot;selected&quot;, &quot;selected&quot;); <br>
$(&quot;#edit-submit-Subscription-Products&quot;).click();</i><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>