JQuery Iteration Over A Checkbox Group
EEGJan 29 2011 — edited Jan 31 2011Hi.
Although I am not new to using APEX, I am new to using JQuery and would much appreciate your help.
I've created an APEX 4.0.1 app in which a page contains 5 checkbox groups. Each of these groups consist of multiple checkboxes.
The first group - it's id equals "MASTER" - contains 4 checkboxes. These checkboxes are labelled (that is, their actual label tags are) "A", "B", "C", "D".
My vision is to have a user check, say, "A" in MASTER and this causes the "A" checkbox group to appear below the MASTER group. If a user then checks "B" in MASTER, then the "B" group appears below the "A" group. If the user then unchecks "A", then the "A" group disappears. And similarly for each of the four "subordinate" groups.
My plan of attack was to iterate over the MASTER checkbox group, and for each checked box, somehow populate an array of their associated label tags. I would do the same for all of the checkboxes in MASTER that are not checked, placing their label tags in another array. I would then show and hide the subordinate checkbox groups based on these label tags. The subordinate groups have label tags equal to these captured label tags in these two arrays. All of this action would be triggered via a "click" action on the "div" section in which the MASTER group resides.
I've tried all manner of techniques, including "$.each" and ".map" to populate arrays. I just can't get my mind around the needed syntax. Please help.
Thank you.
Elie