jquery on submit call a function by name code example
Example 1: put form action jquery
$('#button1').click(function(){
$('#formId').attr('action', 'page1');
});
$('#button2').click(function(){
$('#formId').attr('action', 'page2');
});
Example 2: when a form is subbmited jquery
$("#myform").submit(function(e) {
})