diff --git a/js/ajax.js b/js/ajax.js index ece1038cc6..561b61861c 100644 --- a/js/ajax.js +++ b/js/ajax.js @@ -405,7 +405,9 @@ AJAX.registerOnload('functions.js', function () { // Registering the onload event for functions.js // ensures that it will be fired for all pages $('form').not('.ajax').not('.disableAjax').each(function () { - $(this).data('onsubmit', this.onsubmit).attr('onsubmit', ''); + if ($(this).attr('onsubmit')) { + $(this).data('onsubmit', this.onsubmit).attr('onsubmit', ''); + } }); });