This event can only be used on
elements. jQuery-wrapped form element (or undefined if using jQuery < 1.4) Default value: null. Stack Overflow for Teams is moving to its own domain! Follow edited Jul 13, 2012 at 11:37. answered Jul 13, 2012 at 11:31. This is what worked for me in the most elegant way. Display errors if there are any. If you have an action attribute set for a form element, it will redirect. It uses the dojo.connect() function to handle events. Here is my form and the onClick method. The first thing we need to do is prevent the default form submission behavior from occurring with event.preventDefault(): $('form#formToHandle').submit(function(e) { e.preventDefault(); // do something }); Case 2, dynamic version: If you already listen to the document in your code, then this way would be good for you. Generally, when you do a server side form submit, there is a chance of user clicking the button multiple times which leads to multiple submissions. How ? The $('#form').submit() function is used to submit a form in jQuery. 2. Forms. oh brilliant , the last button can be like this to prevent duplication submit on rapid clicks : Arash Moosapour It is a JavaScript library that helps ease the cross-platform use of JavaScript for web-based applications. This can make your code break if a second form is later added earlier in the page, something that happens frequently, such as if you decide to later add a login form to the header, or even if an invisible or hidden form is added by Use the Dojo Toolkit to Stop the Execution of the Form in JavaScript.