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

require_from_group bug #551

Closed
somatonic opened this issue Nov 14, 2012 · 3 comments
Closed

require_from_group bug #551

somatonic opened this issue Nov 14, 2012 · 3 comments

Comments

@somatonic
Copy link

the additional custom rule "require_from_group" here:
https://github.com/jzaefferer/jquery-validation/blob/master/additional-methods.js#L352

Is buggy, in that it ignores all form fields before the require_from_group fields when submit is clicked.

To fix this you have to add a check for currentElements.lenght == 1

if(validator.currentElements.length == 1) { // fix other fields not getting validated
        if(!$(element).data('being_validated')) {
            var fields = $(selector, element.form);
            fields.data('being_validated', true);
            fields.valid();
            fields.data('being_validated', false);
        }
    }
@jzaefferer
Copy link
Collaborator

This is a duplicate of #412

@somatonic
Copy link
Author

This is not a duplicate as far as I understand it. The issue remains with the current master branch code.

It's not about all other field, but all the previous fields in a form. Fields after the group get validated. I haven't been able to fix the issue with any other solutions out there, but with the code I posted here.

But I'm sure I'm missing something. Thanks anyway :)

@jzaefferer
Copy link
Collaborator

#412 is still open, therefore the issue is still present in master.

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

2 participants