javascript validation in a form
<p>I am having trouble getting this validation to work. I am validating that a selectbox has been chosen and not left on the default option within my form.</p>

<p><strong>Form:</strong></p>

<pre><code>&lt;label for="reason"&gt;How can we help?&lt;/label&gt;
   &lt;select name="reas"&gt;
    &lt;option value="Please Select"&gt;Please Select&lt;/option&gt;
    &lt;option value="Web Design"&gt;Web Design&lt;/option&gt;
        &lt;option value="branding"&gt;Branding&lt;/option&gt;
        &lt;option value="rwd"&gt;Responsive Web Design&lt;/option&gt;&lt;span id="dropdown_error"&gt;&lt;/span&gt;
  &lt;/select&gt;
</code></pre>

<p><strong>Onclick event:</strong></p>

<pre><code>$(document).ready(function(){
    $('#contactForm').submit(function(){
        return checkSelect();
    });
});
</code></pre>

<p><strong>Function:</strong></p>

<pre><code>function checkSelect() {
    var chosen = "";
var len = document.conform.reas.length;
var i;

for (i = 0; i &lt; len; i++){
        if (document.conform.reas[i].selected){
            chosen = document.conform.reas[i].value;
        }
 }

    if (chosen == "Please Select") {
    document.getElementById("dropdown_error").innerHTML = "No Option Chosen";
        return false;
    }
    else{
    document.getElementById("dropdown_error").innerHTML = "";
    return true;
    }
}
</code></pre>

<p>I also get this error in the console:</p>

<pre><code>Uncaught TypeError: Cannot set property 'innerHTML' of null 
</code></pre>

<p>I am really new to javascript, so, I am learning and trying some simple examples at the moment, but I cannot see what is causing this not to validate.</p>

<p>Any help appreciated</p>
