View Full Version : Validation in checkboxgroups

12 Dec 2013, 1:10 PM
I'm having an issue with getting validation to occur consistently in a form which contains a checkboxgroup.

I want to listen for the validitychange event on the form, but under some circumstances when a checkboxgroup is marked as allowBlank: false, unchecking all the child checkboxes doesn't fire the forms validatitychange event when it seems like it should. Specifically, if one of the checkboxes is marked as checked in it's config, unchecking it will not results in the form getting a validitychange event.

Here's the fiddle case:


Note, if you include the checkboxes in the items as you are creating the checkbox it seems to work andyou will see the log.console message from L14.

In 4.2x this seems to work with the .add() case however then you don't see the error message in red around the group like you do in 4.1.1.

Is there some other way to do this with the add()? in my case I'm getting the list of checkboxes in an ajax call after the checkboxgroup is created. The only way I got around it was to add a 'change' listener for the checkbox itself which has the scope of the checkboxgroup and then forced a checkboxgroup.validate().

Kevin Jackson
17 Dec 2013, 2:45 PM
Just checked with the add lines commented and the items uncommented and it worked in 4.1 and 4.2 properly and showed the red indicator for me.

Which browser didn't you see it on in 4.2?

17 Dec 2013, 3:28 PM
Right, but it doesn't work with 4.2.1 or 4.2.2 with the add() commented and items uncommented.

Also my other point is - shouldn't it work with the add() case even in 4.1.1?

Seems like it should but it doesn't seem to.

I was using Chrome but also tried FF too and see the same behaviour.

Kevin Jackson
23 Dec 2013, 9:18 AM
Sorry for the delay in responding. I had a dead HD. Checking through it all now again to see if we are on the same page.