Disable submit functionality for all forms on a HTML page

listed in answer

Disable submit functionality for all forms on a HTML page
0 votes, 0.00 avg. rating (0% score)

ANSWER:

Use event delegation to prevent all form within the body to be submitted.

$("body").on("submit", "form", function( event )
    event.preventDefault();
);

By the way, your Javascript code to disable all links on the page is not a good way to do. You could use instead something like

// use "bind" instead of "on" if you use a jQuery version prior to 1.7
$("a").on( "click", function( ev ) 
    ev.preventDefault();
);

// or use event delegation
$("body").on( "click", "a", function( ev ) 
    ev.preventDefault();
);

// the power of event delegation in action:
// disable BOTH links and form with one event handler
$("body").on( "click", "a, form", function( ev ) 
    ev.preventDefault();
);

Here is a working demo http://jsfiddle.net/pomeh/TUGAa/

by pomeh from http://stackoverflow.com/questions/10283880