title: Dropdown undefined javascript form validation error
body: <p>I have the following sample of html code:</p>
  
  <pre><code>&lt;form id="registration" action="process.php" onsubmit="return validateForm()" method="post"&gt;
      &lt;label for="range_date" class="form"&gt;Select Range Date&lt;/a&gt;&lt;/label&gt;
      &lt;select name="range_date"&gt;
          &lt;option value="" style="display:none;"&gt;&lt;/option&gt;
          &lt;option value="June 27th 2014 6:00pm"&gt;June 27th 2014 6:00pm&lt;/option&gt;
          &lt;option value="June 27th 2014 8:00pm"&gt;June 27th 2014 8:00pm&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form &gt;
  </code></pre>
  
  <p>And the following sample js code:</p>
  
  <pre><code>if (document.forms["registration"]["range_date"] != 'undefined') 
  {
      var range_date=document.forms["registration"]["range_date"].value;
      if (range_date==null || range_date=="")
      {  
          alert("Please select a Range Date");
          return false;
      }  
  }
  </code></pre>
  
  <p>I get an error in firebug stating: "document.forms.registration.range_date is undefined" but I don't expect it to reach the inside of the if statement. Any thoughts?</p>