title: Showing hidden form field when specific URL is passed
body: <p>I have a form that is populated dynamically using URL parameters. The problem is that one of the parameters in the URL selects an option in a dropdown, which should then <code>show</code> a field. That field is not showing on page load.</p>
  
  <p>Note that I have a simple check on page load that should show the field, so I am wondering if URL parameters are passed after the <code>document.ready</code> state.</p>
  
  <p>Here is the URL that I am using:
  <a href="https://donate.globaltc.org/#designation=3&amp;missionary=Jerry%20Nance" rel="nofollow">https://donate.globaltc.org/#designation=3&amp;missionary=Jerry%20Nance</a></p>
  
  <p>The dropdown is selecting the correct option.</p>
  
  <p>Here is my JS:</p>
  
  <pre><code>// Show or hide field
  var $missionary = $('.missionary');
      var $designation = $('#designation');
      var $project = $('.project');
  
      if($designation.val() != 3){
          $missionary.hide();    
      } else {
          $missionary.show();    
      }
  // Handle URL parameters
  var hashParams = window.location.hash.substr(1).split('&amp;'); // substr(1) to remove the `#`
      for(var i = 0; i &lt; hashParams.length; i++){
          var p = hashParams[i].split('=');
          document.getElementById(p[0]).value = decodeURIComponent(p[1]);
      }
  </code></pre>
  
  <p>HTML Form:</p>
  
  <pre><code>&lt;div class="form-group col-sm-6"&gt;
    &lt;label for="exampleInputEmail1"&gt;How would you like this gift to be designated?&lt;/label&gt;
     &lt;select class="form-control" id="designation" name="designation"&gt;
     &lt;option value="1" selected="selected"&gt;Most Urgent Need&lt;/option&gt;
     &lt;option value="3"&gt;A Global Team Member&lt;/option&gt;
     &lt;/select&gt;
   &lt;/div&gt;
   &lt;div class="form-group col-sm-6 missionary"&gt;
     &lt;label for="missionary"&gt;Name of Team Member&lt;/label&gt;
     &lt;input type="text" class="form-control" id="missionary" name="missionary"&gt;
   &lt;/div&gt;
  </code></pre>