Fire javascript on a form submit
You need some jQuery on the page, e.g:

Drupal.behaviors.form_submit_processor = {
  attach: function (context, settings) {
    $("form#my-form").submit(function(e) {
      alert('form submitted');
      alert($('form#my-form #edit-name').val());
    });
  }
}


You could add to your theme script.js, with drupal_add_js or form_alter and $form['#attached'] ( recommended )