From 52e7ad4de5e9abbdfa26c8c17c69c13b987d16cc Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 24 Nov 2022 20:17:36 -0500 Subject: [PATCH] fix: relax selectors for client-side form validation so that all form elements are checked --- public/src/admin/settings.js | 2 +- public/src/modules/settings.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/src/admin/settings.js b/public/src/admin/settings.js index 7af0babd2a..3c271657d2 100644 --- a/public/src/admin/settings.js +++ b/public/src/admin/settings.js @@ -66,7 +66,7 @@ define('admin/settings', ['uploader', 'mousetrap', 'hooks', 'alerts', 'settings' saveBtn.off('click').on('click', function (e) { e.preventDefault(); - const ok = settings.check(document.querySelectorAll('#content [data-field][pattern]')); + const ok = settings.check(document.querySelectorAll('#content [data-field]')); if (!ok) { return; } diff --git a/public/src/modules/settings.js b/public/src/modules/settings.js index 5c78ede9e7..50e05853f3 100644 --- a/public/src/modules/settings.js +++ b/public/src/modules/settings.js @@ -517,7 +517,8 @@ define('settings', ['hooks', 'alerts'], function (hooks, alerts) { save: function (hash, formEl, callback) { formEl = $(formEl); - const controls = formEl.get(0).querySelectorAll('input[name][pattern]'); + const controls = formEl.get(0).elements; + console.log(controls); const ok = Settings.check(controls); if (!ok) { return;