// buttonAction.js
// Javascript to be attached to a submit form.
// Attempts to stop a second submit of the same form info - its impact is
// browser dependent, and requires user to have Javascript on.
// Html requirements:
//       Form name = submitform
//       Submit button name = submitbtn
// Author: Paul
// JS Dependencies: scriptaculous and prototype.

// When the page loads enable the submit button.
Event.observe(window, 'load', function() {

    Element.addMethods('button', {
      enable: Field.enable,
      disable: Field.disable
    })

    //observe form submits - disable the submit button
    Event.observe('submitform', 'submit', function(event) {
        $('submitbtn').disable()
    });
});

