Hi,
We're having some problems with Kendo MVC Validation when data attributes on inputs have no value.
For example (when using FluentValidation integrated with MVC) our inputs are generated as follows:
<
input
class
=
"form-control text-box single-line k-invalid valid"
data-val
=
"true"
data-val-number
=
"The field Range1 must be a number."
data-val-range
=
"'Range1' must be greater than or equal to ''."
data-val-range-max
=
""
data-val-range-min
=
""
data-val-required
=
"'Range1' should not be empty."
id
=
"Range1"
name
=
"Range1"
type
=
"number"
value
=
""
aria-required
=
"true"
aria-describedby
=
"Range1-error"
aria-invalid
=
"true"
>
The problematic code being: data-val-range="'Range1' must be greater than or equal to ''." data-val-range-max="" data-val-range-min=""
When using the input the error appears no matter what value you enter: Range1' must be greater than or equal to ''.
The reason these attributes are generated without values is because they are dynamic/not constant. The FluentValidation rule is that the Range field must be greater than another field on the screen.
I know that I could write custom validation for this rule but actually I am happy for the input to ignore the validation of the range in this case.
The same application works fine when using jQuery validate (jQuery validate ignores the empty range attributes and the form can be submitted).
How do I stop Kendo Validator attempting to validate this attribute? Shouldn't it ignore the attributes as they are empty (not valid), and treat the input as valid?
(image attached shows the problem)
Regards,
Chris