javascript : stop http request when click submit -
now have form validation when click submit shows error sends request server.
if(test == true) .......; else{ if(!adviceblock){ el.insert({after:'<div class="validation-advice">the price should equal or greater <?php echo $minprice; ?>.</div>'}); el.addclassname('validation-failed'); }
how can stop request when submit button clicked ?
you need prevent event listening to:
event.preventdefault()
or, equally, return false function
return false;
Comments
Post a Comment