Hi.

I'm having all sorts of fun with dynamically setting the check in a checkbox.

Which way should I do things?

Initially I thought something like this should work.

$$('#container label
input[type=checkbox][checked]').invoke('writeAttribute', 'checked',
false);

It doesn't.

Instead it seems I have to ...

$$('#container label
input[type=checkbox]').findAll(function(el){!!el.checked;}).each(function(el{el.checked
= false;});

Having worked out this setting the grid became a LOT easier ...

this.labels = $$(this.cssRuleName).invoke('removeClassName', 'cbGridChecked');
$$(this.cssRuleName + ' input[type=checkbox]')
        .each(
                function(el_Checkbox){
                        el_Checkbox.checked = (-1 !=
this.IDs.indexOf(parseInt(el_Checkbox.value, 10)));
                },
                this
        );

Any ideas what is happening?
-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to