diff --git a/validation.js b/validation.js index 4174d77..727ad66 100644 --- a/validation.js +++ b/validation.js @@ -202,9 +202,9 @@ class Validation { for (const nameAttr of this.reqData) { const fields = this.form.querySelectorAll(`[name="${nameAttr}"]:where(input, select, textarea)`) for (const el of fields) { - // checkbox specfic - if (el.type === 'checkbox') { - // combine all data-validation attrs and copy to all checks in the group + // combine all data-validation attr properties between + // check/radio groups and copy to all inputs in the group + if (el.type === 'checkbox' || el.type === 'radio') { const checks = this.form.querySelectorAll(`input[name="${el.name}"]`) let multiOptions = {} for (const check of checks) {