dependant -> dependent
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user