fixed checkboxes still validating while having no value and marked as optional
This commit is contained in:
@ -277,7 +277,7 @@ class Validation {
|
||||
const nameAttrVal = fieldInstance.el.name
|
||||
|
||||
if (!fieldInstance.optional && this.validateForBlank(fieldInstance) ||
|
||||
(fieldInstance.optional && fieldInstance.el.value !== '')) {
|
||||
(fieldInstance.optional && (fieldInstance.el.value !== '' && fieldInstance.el.checked))) {
|
||||
switch (fieldInstance.el.type) {
|
||||
case 'checkbox':
|
||||
this.validateCheckbox(fieldInstance, nameAttrVal)
|
||||
|
Reference in New Issue
Block a user