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

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -