Don't know if this is the reason for this behavior, but the "value"
attribute should have a string value, not a boolean. I.e.

t = MochiKit.DOM.INPUT({'id': 'checkbox_id',
                                         'type': 'checkbox',
                                         'class': 'checkbox_class',
                                         'value': "true",
                                         'checked': false});

/Per

On Thu, May 15, 2008 at 7:04 PM, Szaijan <[EMAIL PROTECTED]> wrote:
>
> Hi Folks,
>
> the following two pieces of code ought to do the same job, as far as I
> can tell, but the MochiKit function produced checkbox elements which
> are checked by default and the JS code produces checkboxes which are
> not checked.  Am I doing something wrong, or is this a bug?
>
> NOTE: Tested in Firefox 2 and 3, and Safari 3.1.
>
> MochiKit Implementation:
>
> t = MochiKit.DOM.INPUT({'id': 'checkbox_id',
>                                          'type': 'checkbox',
>                                          'class': 'checkbox_class',
>                                          'value': true,
>                                          'checked': false});
>
>
> JS Implementation:
>
> t = document.createElement('input');
> t.type = 'checkbox';
> t.className = 'checkbox_class';
> t.id = 'checkbox_id';
> t.value = true;
> t.checked = false;
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to