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

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

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

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