Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty maxlength fails validation #2047

Open
locomo opened this issue Aug 19, 2017 · 6 comments
Open

Empty maxlength fails validation #2047

locomo opened this issue Aug 19, 2017 · 6 comments

Comments

@locomo
Copy link

locomo commented Aug 19, 2017

Subject of the issue

Error thrown on text inputs when maxlength attribute has no value:
"Please enter no more than 0 characters."

Your environment

  • 1.16.0
  • Safari 10.1.2, Chrom 58

Steps to reproduce

https://jsfiddle.net/t80x2L2a/

Input fields with maxlength attribute but no value fail validation

Expected behaviour

If maxlength attribute has no value then it should not (and cannot) be compared to the length of the field

Actual behaviour

length is compared to param (length <= param) but this will always return false if param is empty

@Arkni Arkni added the Core label Aug 31, 2017
@Arkni Arkni self-assigned this Aug 31, 2017
@Arkni
Copy link
Member

Arkni commented Aug 31, 2017

Thanks a lot for filling this issue! I'll triage and take a look at it as soon as possible!

@stale stale bot added the stale Used to mark stale issues label Jun 5, 2018
@locomo
Copy link
Author

locomo commented Jun 5, 2018

bump

@stale stale bot removed the stale Used to mark stale issues label Jun 5, 2018
@stale stale bot added the stale Used to mark stale issues label Aug 4, 2018
@jquery-validation jquery-validation deleted a comment from stale bot Aug 4, 2018
@stale stale bot removed the stale Used to mark stale issues label Aug 4, 2018
@jquery-validation jquery-validation deleted a comment from stale bot Aug 4, 2018
@Arkni Arkni added the Type: Bug label Aug 4, 2018
@Arkni
Copy link
Member

Arkni commented Aug 4, 2018

Hi there,

I don't really have the time for working on this issue. Would you or anyone like to write a patch for this? I'd be more than happy to walk you through the steps involved.

Thanks!

@sunny-shu
Copy link

Hi there,

I don't really have the time for working on this issue. Would you or anyone like to write a patch for this? I'd be more than happy to walk you through the steps involved.

Thanks!

@Arkni
Is this problem solved?if no,i'm happy to figure it out.

@staabm
Copy link
Member

staabm commented Oct 27, 2020

I guess its still valid. Feel free to PR a unit test and a fix

@sunny-shu
Copy link

I have found the problem and fixed it, but I am not very familiar with the jquery testing framework, I need a little time to add test case, then i will submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants