It's a browser bug in setAttribute, IIRC. el.checked does not always
equal el.getAttribute('checked'), and under some circumstances,
el.setAttribute('checked', true) does not change el.checked. I think
el.disabled has the same problem.Attached are unit tests and a patch (based off the trunk as it was in August--I thought I sent this then, but looking back through my sent items, it doesn't look like it was delivered). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype: Core" 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/prototype-core?hl=en -~----------~----~----~----~------~----~------~--~---
writeAttributeBooleans_test.diff
Description: Binary data
writeAttributeBooleans_fix.diff
Description: Binary data
TAG
On Dec 21, 2007, at 2:57 PM, John-David Dalton wrote:
>
> Hi guys,
>
> I have this:
>
> if(!element.checked){
>
> element.next('div').select('input[type=checkbox]').invoke
> ('writeAttribute',
> 'checked', false);
> }
>
> Works once maybe, randomly, mostly not at all.
>
> This works:
>
> if(!element.checked){
>
> element.next('div').select('input[type=checkbox]').each(function(el){
> el.checked = false;
> });
> }
>
> I suspect I am using wirteAttribute wrongly, what say yall.
>
> - John-David
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google
> Groups "Prototype: Core" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to prototype-core-
> [EMAIL PROTECTED]
> For more options, visit this group at http://groups.google.com/
> group/prototype-core?hl=en
> -~----------~----~----~----~------~----~------~--~---
>
