Giter VIP home page Giter VIP logo

Comments (12)

cferdinandi avatar cferdinandi commented on May 26, 2024

Good catch! I completely forgot that checkbox groups were a thing. Fixed with v1.2.4. Demo here (as soon as the CDN cache flushes): https://codepen.io/cferdinandi/pen/KrbBBr

from bouncer.

smcyr avatar smcyr commented on May 26, 2024

It's better, but if you comment out the javascript, Firefox or Chrome validate each checkbox independtly. So, it's different from the radio buttons where just one is required. Also, see this pen:
https://codepen.io/anon/pen/vQvaPZ
The first and the last are required, but the middle one still has the error class. Just the first one and the last one should be validated in this case. And if you check the first one, the last one should still have the error, to be consistent with the browser validation.
Thanks!

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

Ah right, good point! So, we only want to validate required checkboxes in this case?

from bouncer.

smcyr avatar smcyr commented on May 26, 2024

Yes, the validation in the case of checkbox groups should be independent for each checkbox as if they had different name="".

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

Ok, so... forgive me but, wasn't that the original behavior? Validate each checkbox on its own?

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

No, you're right, I just worked backwards to see what was happening in older versions. Sorry! Coffee hasn't quite kicked in yet today! ☕️😂

I'll get this sorted. Each checkbox should have its own error message and validation, with the error message appearing before/after the label instead of the input.

from bouncer.

smcyr avatar smcyr commented on May 26, 2024

Ahah, no problem, I like your library and wanted to use it instead of a bloated jQuery plugin :) Thanks!

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

Alright, officially fixed with v1.2.5: https://codepen.io/cferdinandi/pen/KrbBBr

from bouncer.

smcyr avatar smcyr commented on May 26, 2024

Thanks, but it seems that the logic was also implemented for radio buttons groups, but those are different, there must be only one error message for the group.
https://codepen.io/smcyr/pen/NEJLyO
Check the behavior with or without javascript.
Thanks!

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

It shouldn't have been. Hmmm

from bouncer.

cferdinandi avatar cferdinandi commented on May 26, 2024

Sigh, ok. Hopefully finally have this nailed down. v1.3.0 https://codepen.io/cferdinandi/pen/KrbBBr

from bouncer.

smcyr avatar smcyr commented on May 26, 2024

Seems to be working perfectly, thanks!

from bouncer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.