victorjonsson / jQuery-Form-Validator

[DISCONTINUED] jQuery plugin that makes it easy to validate user input while keeping your HTML markup clean from javascript code.
972 stars 476 forks source link

Maxlength attribute overrides the data-validation-length attribute #658

Closed etcho closed 6 years ago

etcho commented 6 years ago

I was trying to use data-validation="required length" data-validation-length="1000-2000" maxlength="2000". After hitting my head on the wall for several minutes, I inspected the generated HTML and the data-validation-length attributes was setted to "max2000". Removing the maxlength attribute make it work.

Is it ok for maxlength to override the data-validation-length?

victorjonsson commented 6 years ago

Why do you need to combine maxlength and data-validation-length? Wouldn't it be enough to only use data-validation="required length" and leave out the max-length attribute?

etcho commented 6 years ago

Well, I have to agree that it works. I was just trying to be extra careful since the form's users are wild beings. But, yes. It will do it.