On May 19, 2006, at 9:11 PM, Beau Hartshorne wrote:
> On 19-May-06, at 11:58 AM, mario ruggier wrote:
>
>> On May 19, 2006, at 8:37 PM, Beau Hartshorne wrote:
>>>
>>> What's the best way to do the equivalent of element.checked = false;
>>> with DOM/MochiKit?
>>>
>>> Beau
>>
>> I had run into similar problem some time ago, about how to really
>> unset a boolean attribute.
>> Setting to false is not enough... best is to do something like:
>>
>> function uncheck() {
>> element.removeAttribute('checked');
>> }
>> function check() {
>> setNodeAttribute(element, 'checked', true);
>> }
>>
>> mario
>
> removeAttribute won't clear a checkbox that was checked by a user, it
> only works on checkboxes that have had the checked attribute set
> somehow. I'll take Bob's suggestion and use element.checked = false.
>
> Beau
The problem I had had was with "disabled" on an input submit element.
Do not remember the different scenarios, but IIRC if I start out with
the element disabled, and then try to enable it on the client, it just
did not work... if I access the element, i.e. disable it and enable it,
via the dom exclusively, then it works, at least in all the main
clients. Maybe disabled behaves differently than checked, as checked is
a user-modifiable state of the element "by nature", while disabled is
not.
mario
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit
-~----------~----~----~----~------~----~------~--~---