mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
fix: relax selectors for client-side form validation so that all form elements are checked
This commit is contained in:
@@ -66,7 +66,7 @@ define('admin/settings', ['uploader', 'mousetrap', 'hooks', 'alerts', 'settings'
|
|||||||
saveBtn.off('click').on('click', function (e) {
|
saveBtn.off('click').on('click', function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
const ok = settings.check(document.querySelectorAll('#content [data-field][pattern]'));
|
const ok = settings.check(document.querySelectorAll('#content [data-field]'));
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -517,7 +517,8 @@ define('settings', ['hooks', 'alerts'], function (hooks, alerts) {
|
|||||||
save: function (hash, formEl, callback) {
|
save: function (hash, formEl, callback) {
|
||||||
formEl = $(formEl);
|
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);
|
const ok = Settings.check(controls);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user