Fix #14460 - Do not submit forms multiple times on CTRL + ENTER
Fixes: #14460 Pull-request: #14968 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
20f141b291
@ -4890,8 +4890,11 @@ AJAX.registerOnload('functions.js', function () {
|
||||
$('form input, form textarea, form select').on('keydown', function (e) {
|
||||
if ((e.ctrlKey && e.which === 13) || (e.altKey && e.which === 13)) {
|
||||
$form = $(this).closest('form');
|
||||
if (! $form.find('input[type="submit"]') ||
|
||||
! $form.find('input[type="submit"]').click()
|
||||
|
||||
// There could be multiple submit buttons on the same form,
|
||||
// we assume all of them behave identical and just click one.
|
||||
if (! $form.find('input[type="submit"]:first') ||
|
||||
! $form.find('input[type="submit"]:first').trigger('click')
|
||||
) {
|
||||
$form.submit();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user