Hi, I'm calling on those with Prototype/CSS selector foo to help with a somewhat tricky issue.
I have a tree structure where each item is hierarchical. This is used to manage software components. Think of the case where you're installing a piece of software, and want to customize which packages are installed:
Internet Email Thunderbird Evolution Outlook Express Browsing Firefox Internet Explorer Entertainment Music iTunes Winamp
In this menu, if the user clicks on a given checkbox, I want all sub elements to check as well (and the same on uncheck, obviously).
Since there are all simple checkboxes, I tried attaching this function to onclick:
function toggle_children (input) { // locate "input#myid input" (all children) $$('input#'+input.id+' input').each(function (item) { if (input.id !== item.id) { item.checked = input.checked; } }); }
But unfortunately, that did not select the elements. The pure CSS selector that should work is:
input#myid > input
However, unfortunately passing that to Prototype gives "error parsing selector at: > "
Ideas?
Thanks, Nate