Html5 Form Validation With Required And Disabled Element
Solution 1:
http://www.w3.org/TR/html5/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute:
Constraint validation: If an element is disabled, it is barred from constraint validation.
http://www.w3.org/TR/html5/forms.html#barred-from-constraint-validation:
A submittable element is a candidate for constraint validation except when a condition has barred the element from constraint validation.
And finally, from the list of Constraint validation steps, http://www.w3.org/TR/html5/forms.html#constraint-validation:
3.1: If field is not a candidate for constraint validation, then move on to the next element.
That means, a disabled element will just be “passed over” when form validity is checked.
It doesn’t trigger any errors, and has no influence whatsoever on the validation state of the form it belongs to.
Post a Comment for "Html5 Form Validation With Required And Disabled Element"