diff options
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/behaviour.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/scripts/behaviour.js b/lib/scripts/behaviour.js index f9aad3d02..968d2dd5f 100644 --- a/lib/scripts/behaviour.js +++ b/lib/scripts/behaviour.js @@ -102,15 +102,18 @@ var dw_behaviour = { /** * Autosubmit quick select forms * - * When a <select> tag has the class "quickselect", this script will + * When a <select> or <input> tag has the class "quickselect", this script will * automatically submit its parent form when the select value changes. * It also hides the submit button of the form. * + * This includes a workaround a weird behaviour when the submit button has a name + * + * @link https://trackjs.com/blog/when-form-submit-is-not-a-function/ * @author Andreas Gohr <andi@splitbrain.org> */ quickSelect: function(){ - jQuery('select.quickselect') - .on('change', function(e){ e.target.form.submit(); }) + jQuery('.quickselect') + .change(function(e){ HTMLFormElement.prototype.submit.call(e.target.form); }) .closest('form').find(':button').not('.show').hide(); }, |