我有带消息框的bootstrap模式弹出窗口。我已经在表单提交上写了一些条件,但我想用表单提交验证相同的表单
<form action="" method="post" onSubmit="popUpToggle();" id="myModal2" >
<div class="form_fields feedbackfield">
<textarea id="txtMessage" name="txtMessage" rows="5" class="form-control contact-input" placeholder="Message *" required></textarea>
</div>
<div class="form_fields">
<input type="submit" class="contact-submit" name="SUBMIT" value="SUBMIT">
</div>
</form>
脚本是
<script>
setTimeout(function() {
if(localStorage.getItem("modalPopup")){$("#myModal2").modal('hide');}
else{$('#myModal2').modal('show');}
}, 5000);
function popUpToggle(){
localStorage.setItem("modalPopup", "commit");
}
</script>