dependant -> dependent

This commit is contained in:
2025-04-12 11:39:09 -04:00
parent 28e5b39962
commit e114c8a175
2 changed files with 11 additions and 11 deletions

View File

@ -1,5 +1,5 @@
class ValidationField {
dependant = null
dependent = null
el = null
formGroupEl = null
isValid = null
@ -96,12 +96,12 @@ class ValidationField {
// add a native pattern attr if pattern property is present
if (this.pattern) this.el.setAttribute('pattern', this.pattern)
// dependant fields
if (this.dependant) {
const parents = this.validationInstance.form.querySelectorAll(`[name="${this.dependant}"]`)
// dependent fields
if (this.dependent) {
const parents = this.validationInstance.form.querySelectorAll(`[name="${this.dependent}"]`)
const depCheck = () => {
if (((parents[0].type === 'checkbox' || parents[0].type === 'radio') && this.validationInstance.form.querySelectorAll(`[name="${this.dependant}"]:checked`).length > 0) ||
if (((parents[0].type === 'checkbox' || parents[0].type === 'radio') && this.validationInstance.form.querySelectorAll(`[name="${this.dependent}"]:checked`).length > 0) ||
(((parents[0].type !== 'checkbox' && parents[0].type !== 'radio') && parents[0].value))) {
this.el.removeAttribute('disabled')
} else {