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

Core: Add capability to check array of inputs #2431

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ridea-co
Copy link

@ridea-co ridea-co commented Jul 1, 2022

Description

Add capability to check array of inputs.
Basically a copy & paste code from #2000 with checkbox/radio check

@bytestream
Copy link
Member

bytestream commented Jul 1, 2022

What's the checkbox/radio check for?

Does it display error messages correctly?

@bytestream bytestream linked an issue Jul 1, 2022 that may be closed by this pull request
@ridea-co
Copy link
Author

ridea-co commented Jul 2, 2022

The reason of filtering out radios and checkboxes is that when you have multiple radio buttons or checkboxes with same name, I believe user really expecting only one of then to be selected instead all of them have to be selected. So for those 2 types of inputs, they fall back to the original program logic thus error message should display correctly.

@ridea-co
Copy link
Author

ridea-co commented Jul 5, 2022

Hi, just wondering if everything look good to be merged in?

@github-actions
Copy link

github-actions bot commented Sep 4, 2022

This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automatically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up.
Thank you for contributing :)

@github-actions github-actions bot added the stale Used to mark stale issues label Sep 4, 2022
@bytestream bytestream added NEEDS REVIEW and removed stale Used to mark stale issues labels Sep 5, 2022
@@ -454,7 +454,16 @@ $.extend( $.validator, {
checkForm: function() {
this.prepareForm();
for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) {
this.check( elements[ i ] );
var toBeChecked = this.findByName( elements[ i ].name );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to replace that line by:

Suggested change
var toBeChecked = this.findByName( elements[ i ].name );
var toBeChecked = this.findByName( elements[ i ].name ).not( this.settings.ignore );

Copy link

@Seb33300 Seb33300 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the requested change

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

Successfully merging this pull request may close these issues.

Error in not validating array's of inputs correctly.
3 participants