title: Modal Popup Validation not working
body: <p>I have bootstrap modal popup with Message box. I have write some conditions on form submit but i  want to validate same form with form submit</p>
  
  <pre><code>&lt;form action="" method="post" onSubmit="popUpToggle();" id="myModal2" &gt;
  &lt;div class="form_fields feedbackfield"&gt;
  &lt;textarea id="txtMessage" name="txtMessage" rows="5" class="form-control contact-input" placeholder="Message *" required&gt;&lt;/textarea&gt;
  &lt;/div&gt;
  &lt;div class="form_fields"&gt;
  &lt;input type="submit" class="contact-submit" name="SUBMIT" value="SUBMIT"&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And Script is</p>
  
  <pre><code>&lt;script&gt;
  setTimeout(function() {
              if(localStorage.getItem("modalPopup")){$("#myModal2").modal('hide');}
              else{$('#myModal2').modal('show');}
  
          }, 5000);
  
          function popUpToggle(){
              localStorage.setItem("modalPopup", "commit");
          }
  &lt;/script&gt;
  </code></pre>