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

isekai-main
Julian Lam 2 years ago
parent d8b45c61f7
commit 52e7ad4de5

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

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

Loading…
Cancel
Save