Chrome Extension

Detect form submit jQuery

$("form").submit(function() {
    var val = "";
    if (val === "") {
        return false; //THIS WILL PREVENT FORM TO SUBMIT
    } else {
        return true; //THIS WILL SUBMIT THE FORM
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

You can check form submit event on the webpage using jQuery. We are using .submit() function to detect form submit here in the code snippet. To select form HTML element, we are using tag name 'form' and attaching .submit() function 

Search Index Data (The code snippet can also be found with below search text)

prevent form to submit jQuery
Was this helpful?
Join Devsheet Ask a Question