When setting an input with required="false", a value is required.
jquery-validate: 1.18.0add an input tag with required="false". On validation, it will be required to have a value (which should not be the case).
an input with required="false" should not have its value required.
The value is required.
To correct this, in the attributeRules function, the test should be :
if ( value === "" ) {
value = true;
}
else if ("false" === value) {
value = false;
}
Hi @eproffit,
Thanks a lot for filling this issue! I'll take a look at it as soon as possible!
Hi all,
If anyone is interested in writing a patch for this issue, I'd be more than happy to walk you through the steps involved, as I can't work on it at the moment.
Thanks!
An input tag with required(whatever ' required="true" ' or ' required="false" ' ).it will be required to have a value.This is the case in HTML.
Yeah, I don't think "false" is valid:
From the W3 docs for the required attribute,
The required attribute is a boolean attribute. When specified, the element is required.
And for the definition of a "boolean attribute",
The presence of a boolean attribute on an element represents the true value, and the absence of the attribute represents the false value.
If the attribute is present, its value must either be the empty string or a value that is an ASCII case-insensitive match for the attribute’s canonical name, with no leading or trailing white space.
The values "true" and "false" are not allowed on boolean attributes. To represent a false value, the attribute has to be omitted altogether.
So it's either required="required" or simply required, but required="true" or required="false" are not expected.
Most helpful comment
Yeah, I don't think
"false"is valid:From the W3 docs for the required attribute,
And for the definition of a "boolean attribute",
So it's either
required="required"or simplyrequired, butrequired="true"orrequired="false"are not expected.