mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +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) {
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user