Bumping this. I am using 1.7. I have tried using writeAttribute on a single
html element and seems to be doing the same thing mentioned. This only
happens after I actually click on the checkbox if a refresh the page it
works as normal, but once I click it stops working.
Here is my code:
$('adminSubContractorPopActiveInput').writeAttribute({checked:jsonSubContractor['active']});
'active' is a boolean
got around this by doing this:
$('adminSubContractorPopActiveInput').checked = jsonSubContractor['active'];
Why would the first not work? Second works even after clicking on element.
Any help would br appreciated.
On Thursday, September 9, 2010 8:31:38 AM UTC-5, RQuadling wrote:
>
> 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 view this discussion on the web visit
https://groups.google.com/d/msg/prototype-scriptaculous/-/5pT1usKQb5sJ.
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/prototype-scriptaculous?hl=en.