fix: relax selectors for client-side form validation so that all form elements are checked

This commit is contained in:
Julian Lam
2022-11-24 20:17:36 -05:00
parent 0e319a58cb
commit 43e7c98824
2 changed files with 3 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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;