title: Javascript validation with onsubmit function not working in IE8 and IE7
body: <p>I have a simple html form for which I want to validate the 2 inputs. The validation works fine in Chrome, Firefox, IE9 and IE10. i.e. If I dont enter any values for plat and plng, the submit isnt executed in these browsers.</p>
  
  <p>However in IE8 and IE7, the validation fails and I end up submitting the form and execute /php/search.php.</p>
  
  <p>I am sourcing Jquery 1.8.3 on the page.</p>
  
  <pre><code>&lt;form class="form-wrapper cf" id="search-form-primary" action="/php/search.php" method="post" onsubmit="return validateForm();"&gt;
      &lt;input id="plat" name="plat" value="" type="text" &gt;
      &lt;input id="plng" name="plng" value="" type="text" &gt;
      &lt;button id="search" type="submit"&gt;Search&lt;/button&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
      function validateForm() {
          var latt= $('#plat').val();
          var lngi = $('#plng').val();   
          if ((latt == "") || (lngi == "") || (latt == null) || (lngi == null))
              return false;
          else
              return true;
          }       
  &lt;/script&gt;
  </code></pre>