how to do validation for form and popup at at a time in ajax

Apr 2 2018 12:24 PM
Hi guys  how to do validation for form and popup at at a time in ajax?
 
here popup is coming on button click ,,, but before show popup i want to validate form requirefield ?  
 
<form class="form-horizontal login-filds">
<div class="form-group">
<div class="col-sm-12">
<input type="text" class="form-control" id="name" name="name" placeholder="Your Name"  required/>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">
<input type="email" class="form-control" id="email" name="email" placeholder="Your Email ID *" required />
</div>
</div>
<input type="button" class="payment-details-submit" id="modelpaymentMode" data-toggle="modal" data-target="#paymentMode" value="SUBMIT " />
</div>
</div>
</form>
 
 ///////popup
<div class="modal fade" id="paymentMode" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog login-dialog" role="document">
<div class="modal-content">
<div class="modal-body login-body payment-mode-width">
<div class="payment-mode">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<img src="images/payment-clock.svg" width="25" class="payment-mode-clock">
<p>Remaning Time</p>
<span><div id="clockdiv"></div></span>
</div>
</div> </div> </div> </div> </div> </div> </div>
 
 
here popup is coming on button click ,,, but before show popup i want to validate form requirefield ? 
 

Answers (7)