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
creditcard validation throws error only on mobile Safari #1767
Comments
Could you provide a reduced jsfiddle which reproduces your issue? |
I distilled it down as best as I could to this: https://jsfiddle.net/xt6yasLt/15/ In doing this I found that what seems to cause the problem is the max property of the input field. It works in most browsers, but mobile safari doesn't seem to like it. I have guessing that 9999999999999999 is overflowing in that browser. |
This comment has been minimized.
This comment has been minimized.
having the same issue. not only safari iOS but safari desktop (v12 on OS mojave) |
Hi all, Re-opening this issue as the bug still persist. I will try to fix the issue as soon as I got some free time, but if anyone is interested in fixing this issue and submit a proposal, please do. I'd be more than happy to walk you through the steps involved. And, sorry about the closing of this issue by our bot. |
Something similar is happening to me, in Firefox 72.0.1 on Ubuntu 19.10 but with the minLength rule.
The error seems to happen only for fields with the minLength or maxLength restrictions. This seems to be quite an important bug, to be honest. I'd be happy to try to fix this bug. Any guidance would be more than welcome @Arkni |
I've tried with jQuery 3.1 and 3.4 with no luck. Perhaps that's the reason of the bug. I'm using the jQuery migrate as well but it doesn't improve. |
jQuery Core 2.2.4 doesn't help wither. |
Alright, I've already figured out what was going on. This plugins works great with jQuery 3.4.1 and without the jQuery migration script. Except when you use the minLength and maxLength restrictions. Then I saw issues when using the highlight / unhighlight JS options. If not using them, then it works normally. |
Versions:
This code works fine on all other tested browsers (desktop and mobile) but in mobile Safari when calling the .validate for the page I receive:
the error is reported as coming from jquery.validate.min.js:276
The rule for this field is simply:
{ required: true, creditcard: true }
My current workaround is to change the rule to:
{ required: true, digits: true, minlength: 12, maxlength: 16 }
when I detect an iOS device. This seems to work but is not ideal.
The text was updated successfully, but these errors were encountered: