title: How to Validate form by using OnChange Javascript HTML
body: <p>I am trying to do an extra check on a form using OnChange so an alert box appears if the text if equal to a specific value BEFORE the form is submitted. If i remove the If value then the alert box WILL appear but its not coming up if the field is set to 'No Longer Required'</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  /*&lt;![CDATA[*/
  function extracheck(s) {
  
  if (s.value == "No Longer Required"){
  alert("message here");
  }
  }
  
  /*]]&gt;*/
  &lt;/script&gt;
  
   &lt;form id="form2" name="form2" method="post" action="returnprocess.asp" onSubmit="return     validateForm(this)"&gt;
    &lt;select name="Reason1" class="textfieldmedium" id="Reason1" onchange="extracheck(this)"&gt;
                          &lt;option selected="selected"&gt;Reason for Return&lt;/option&gt;
                         &lt;option&gt;No Longer Required&lt;/option&gt;
                          &lt;option&gt;Duplicated Order&lt;/option&gt;
                          &lt;option&gt;Choice of Two&lt;/option&gt;
                          &lt;option&gt;Incorrectly Supplied&lt;/option&gt;
                          &lt;option&gt;Incorrect for Application&lt;/option&gt;
                          &lt;option&gt;Incorrectly Packaged&lt;/option&gt;
                          &lt;option&gt;Late Delivery&lt;/option&gt;
                          &lt;option&gt;Incorrectly Picked&lt;/option&gt;
                          &lt;option&gt;Never Ordered&lt;/option&gt;
                          &lt;option&gt;Surcharge Unit&lt;/option&gt;
                          &lt;option&gt;Damaged&lt;/option&gt;
                          &lt;option&gt;Poor Fitment&lt;/option&gt;
                            &lt;/select&gt;
        &lt;/form&gt;
  </code></pre>
  
  <p>Why isnt the alert box coming up when there is an IF statement ?</p>