fixed radios still validating while having no value and marked as optional
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user