jQuery ajax use context to callback in form with event preventDefault


Example we have a form like this

We want validate with ajax, and if error, make form not submit. Right? But preventDefault, is not working inside the ajax.

If we using the variable and then make return, it’s also not working.

So, we need use context, to make ajax callback and submit the form.


  1. Greate post. Keep posting such kind of info on your blog.

    Im really impressed by your site.
    Hey there, You have done a fantastic job. I’ll definitely digg
    it and in my view recommend to my friends. I’m sure they’ll be benefited from this web site.

  2. Excellent blog! Do you have any tips for aspiring writers?
    I’m planning to start my own website soon but I’m a little lost
    on everything. Would you recommend starting with a free platform like WordPress or go
    for a paid option? There are so many options out there
    that I’m totally confused .. Any tips? Thanks!


Please enter your name here
Please enter your comment!