minLength and maxLength are validated even when field is not required
rophini92 opened this issue · comments
Hi,
Great validation library, but I have an issue...
Describe the bug
When I set minLength and/or maxLength on a field that is not required, I expect no validations errors when te field is empty. But the validation kicks in.
Expected behavior
As the field is not 'required', the minLength and maxLength validation should be valid. The min and/or maxlength should only be validated when the user has filled in the field
Thanks!
Hi! Could you please make sure you are using the latest version? And could you please share your code, as you can check it here it doesn't validate field if it's not required
Ah, my fault, sorry, I was to quick. I wrote my own kind of handler to use html-attributes to create and validation rules using your library. I had to parse my minlength attribute to an int!