You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FormHelper generates the same oninvalid code for text inputs and checkoxes: this.setCustomValidity(''); if (!this.value) this.setCustomValidity(this.dataset.validityMessage)
In case of checkboxes, !this.value is always false, because it can be true only if checkbox value="".
Condition should be !this.checked instead - this will allow to show custom error message for unchecked required checkbox.
CakePHP Version
4.5.4, 5.0
PHP Version
No response
The text was updated successfully, but these errors were encountered:
In cakephp 3 condition was !this.validity.valid.
Not sure why it was changed. Maybe because another types of validation were added, like invalid email format or min/max values etc.
Description
FormHelper generates the same
oninvalid
code for text inputs and checkoxes:this.setCustomValidity(''); if (!this.value) this.setCustomValidity(this.dataset.validityMessage)
In case of checkboxes,
!this.value
is always false, because it can be true only if checkbox value="".Condition should be
!this.checked
instead - this will allow to show custom error message for unchecked required checkbox.CakePHP Version
4.5.4, 5.0
PHP Version
No response
The text was updated successfully, but these errors were encountered: