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

numberOfInvalids() doesnt account for groups #42

Closed
simshaun opened this issue Feb 9, 2011 · 4 comments
Closed

numberOfInvalids() doesnt account for groups #42

simshaun opened this issue Feb 9, 2011 · 4 comments
Milestone

Comments

@simshaun
Copy link
Contributor

simshaun commented Feb 9, 2011

For example:

  1. There are 3 required fields on a form.
  2. 2 of them are grouped using the groups option
    *This causes 2 errors to be displayed

Calling numberOfInvalids() in invalidHandler returns 3 (there were indeed 3 total errors), but only 2 errors are displayed.

I think there needs to be a way to get the number of errors that are displayed to the user.

@CraigStuntz
Copy link

Well, you can do it with:

var numberOfErrorMessages = $("#myForm :input.error").length;

@mlynch
Copy link
Contributor

mlynch commented May 4, 2012

@jzaefferer thoughts on this? I'm not sure what numberOfInvalids was initially meant for.

@jzaefferer
Copy link
Collaborator

This demo is using numberOfInvalids: http://jzaefferer.github.com/jquery-validation/demo/marketo/

Taking groups into account seems reasonable.

@jzaefferer
Copy link
Collaborator

I'm sorry for the lack of activity on this issue. Instead of leaving it open any longer, I decided to close old issues without trying to address them, to longer give the false impression that it will get addressed eventually.

To the reporter (or anyone else interested in this issue): If you're affected by the same issue, consider opening a new issue, with a testpage that shows the issue. Even better, try to fix the issue yourself, and improve the project by sending a pull request. This may seem daunting at first, but you'll likely learn some useful skills that you can apply elsewhere as well. And you can help keep this project alive. We've documented how to do these things, too. A patch is worth a thousand issues!

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

No branches or pull requests

4 participants