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

[Formvalidation] Support checkbox groups for "checked" rule like radio groups #540

Merged
merged 1 commit into from
Mar 8, 2019

Conversation

lubber-de
Copy link
Member

@lubber-de lubber-de commented Mar 6, 2019

Description

Checkbox groups where the checkboxes share the same name property were only "checked" validated if every single checkbox within the group was checked. This is wrong, it should behave the same as the radio group "checked" validation (SUI does it)

Hint: The example uses the same name attribute for each checkbox also with a bracket suffix "[]"
The form validator already supports using this selector by putting it into quotes .
Hint 2: selector.checkbox covers checkbox and radiobutton aswell..in case you wonder if the old behavior with radio still works

fields: {
    "sizes[]": 'checked'
  },

Testcase

Broken

Every toggle checkbox has to be checked to pass the validation
https://jsfiddle.net/ogz73ks5/

Fixed

Only one checkbox has to be checked to pass validation
https://jsfiddle.net/ogz73ks5/2/

Screenshot

Broken Fixed
checkboxgroup_bad checkboxgroup_good

@lubber-de lubber-de added lang/javascript Anything involving JavaScript state/awaiting-reviews Pull requests which are waiting for reviews 🐛 bugfix labels Mar 6, 2019
@lubber-de lubber-de added this to the 2.7.3 milestone Mar 6, 2019
@crewow
Copy link

crewow commented Mar 7, 2019

That's great , I Love FUI

Copy link
Member

@y0hami y0hami left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@prudho prudho left a comment

Choose a reason for hiding this comment

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

LGTM

@y0hami y0hami merged commit 878b69a into fomantic:develop Mar 8, 2019
@y0hami y0hami removed state/awaiting-reviews Pull requests which are waiting for reviews labels Mar 8, 2019
@y0hami y0hami mentioned this pull request Apr 1, 2019
@lubber-de lubber-de deleted the fix/checkbox_group_validation branch April 2, 2019 09:04
@exoego exoego added type/bug Any issue which is a bug or PR which fixes a bug and removed 🐛 bugfix labels May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang/javascript Anything involving JavaScript type/bug Any issue which is a bug or PR which fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants