Disable submit buttons when submitting a form (#6555).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9391 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-04-13 17:01:46 +00:00
parent 4edc30d157
commit 43c677b489
1 changed files with 12 additions and 0 deletions

View File

@ -520,4 +520,16 @@ function hideOnLoad() {
}); });
} }
function addFormObserversForDoubleSubmit() {
$$('form[method=post]').each(function(el) {
Event.observe(el, 'submit', function(e) {
var form = Event.element(e);
form.select('input[type=submit]').each(function(btn) {
btn.disable();
});
});
});
}
Event.observe(window, 'load', hideOnLoad); Event.observe(window, 'load', hideOnLoad);
Event.observe(window, 'load', addFormObserversForDoubleSubmit);