fixed radios still validating while having no value and marked as optional

This commit is contained in:
2025-04-07 11:05:02 -04:00
parent b232313c59
commit eb9a292586

View File

@ -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) {