Thats the way I do it with prototype:

function selectAll(){
    // use prototype to select all elements in an array
    $$('input:[type=checkbox]').each(function(e){ e.checked = true; });
}
function deselectAll(){
    // use prototype to select all elements in an array
    var inputs = $$('input:[type=checkbox]');
    inputs.each(function(e){ e.checked = false;});
}

with you main checkbox to handle to above function call - of course
you can use something different to
select you checkboxes ;) other than 'input:[type=checkbox]' in prototype.

On Tue, Jul 22, 2008 at 10:16 AM, RJ <[EMAIL PROTECTED]> wrote:
>
> I have a scenario where on checking a main checkbox, all the other
> checkboxes should be checked
>
> eg:
> main checkbox: $form->checkbox('main',array('onClick' => 'check()'))

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to