On Dec 18, 12:18 pm, Kupido <[email protected]> wrote:
> Unfortunately I need my application to be compatible with IE too... :(
>
> What about the initialization function?
>
> Object.extend(Form.Methods, {
> initialize: function (form)
> {
> form = $(form);
>
> form.property1 = 'test';
> form.property2 = ['t', 'e', 's', 't'];
>
> // and so on
> }
>
> });
>
> This is working for stardard forms but not for dinamically created
> forms (document.createElement). Why?
> Is there a better way of doing this?
I'm not sure how this could work and what exactly it does. A preferred
way to add properties to FORM elements is by using `Element.addMethods
('form', { /* ... */ })`. The only "problem" is that Prototype
discards any properties which are not functions (or rather those that
return falsy result from `Object.isFunction`). That is why your "non-
function" properties are never applied. This was brought up before but
doesn't seem like an important (or even necessary) addition. You can
always open a ticket, of course ; )
--
kangax
--~--~---------~--~----~------------~-------~--~----~
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 [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
-~----------~----~----~----~------~----~------~--~---