Forums

event disable checkbox_group

gate 29 Apr, 2015
hi folks,

I got an issue with the event function of radio boxes for a checkbox_group.

I have the standard radio buttons 0=Yes and 1=No.
If value 0 is selected, the following "checkbox_group59" is enabled.
If value 1 is selected the following "checkbox_group59" is disabled.

theoretically that works fine, the problem is, that only the first checkbox of my "checkbox_group59" is enabled or disabled, checkboxes two to five of the group are always enabled regardless the radio button value.

is that a bug or did I miss something important when establishing that event?

as an maybe important/unimportant info:
checkbox_group is set up with the following scheme ->
1=abc
2=def
3=ghi
4=jkl
5=mno

greetings
Gate
GreyHead 29 Apr, 2015
Hi Gate,

I suspect that this may be because you are using 0 as a value. It has an ambiguous value in the JavaScript. Please test using say
abc=abc
def=def
ghi=ghi
jkl=jkl
mno=mno

Bob
gate 30 Apr, 2015
Hi Bob,

I changed the radiobutton values to 1=Yes and 2=No, to avoid the 0.
Afterwards I deleted the numeric values in the checkbox_group and changed them to

ABC=ABC
DEF=DEF
GHI=GHI
JKL=JKL

But even with deleted cache its still the same result, checkbox "ABC" gets disabled and enabled correctly, but the others are always enabled.

greetings
gate
GreyHead 30 Apr, 2015
Hi Gate,

Please take a Form Backup using the icon in the Forms Manager and post it here and I'll take a closer look.

Bob
gate 30 Apr, 2015
Hi Bob,

form-backup is attached...

event is configured in "radio53" and concerns "checkbox_group54"

greetings
gate
GreyHead 30 Apr, 2015
Answer
1 Likes
Hi Gate,

I think I see the problem here. You are using Enable/Disable and that requires that you specify the ID of an element. If you look at the checkboxes in the group they each have a different ID checkbox_group54, checkbox_group541, checkbox_group542 . . .

You can use Show Parent/Hide Parent instead; or you can add a lot more events; or you can use Custom JavaScript to do the enabling/disabling - jQuery will let you select and change all of the elements inside a div.

Bob
gate 30 Apr, 2015
Hi Bob,

thanks a lot for your help!!!
I know its the least elegant way, but entering the IDs of the single checkboxes of the group is what was working the best for me 😉

greetings
gate
GreyHead 01 May, 2015
Hi gate,

Whatever works . . .

Note that if you edit the form in the future it is possible that the ids may change. I've recorded that as a bug with Max but I think that is it low on his to-do list.

Bob
This topic is locked and no more replies can be posted.