How to use onsubmit in forms?

It's possible to set the ACTION of a form though the GUI. But how do I add an ONSUBMIT handler to the form?

ACTION is run after ONSUBMIT, and within ONSUBMIT I can stop submitting the form by returning FALSE. Hence, if a local JS function is run, it's better to use ONSUBMIT than ACTION.

Give your form an id, e.g "myform". Create a js file for your project and define $("#myform").submit(function(e) {....}). If you need to stope the submit, use e.preventDefault() instead of returning false. I like doing it this way because your js won't be triggered unless the form passes any HTML5 validation you have defined.