User property of a <form> element is not enumerable

View: New views
3 Messages — Rating Filter:   Alert me  

User property of a <form> element is not enumerable

by Honza (Jan Odvarko) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If I create a <form> element and set a new property on it, it's not
visible when enumerating properties.

As far as I know it's because <form> elements implement an enumerate
hook to access form fields.

Is there a way how this hook can be bypassed to get user defined
properties? (I am a Firefox extension - Firebug)

Example:

var form= document.createElement('form');
form.myProp = {ID:'test', Value:'someValue'};

// Following cycle doesn't see the "myProp" property
for (var p in form) {
    // ...

}

Thanks!
Honza
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: User property of a <form> element is not enumerable

by Blake Kaplan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"Honza (Jan Odvarko)" <odvarko@...> wrote:
> As far as I know it's because <form> elements implement an enumerate
> hook to access form fields.

Is there a bug filed on this? We can fix it, it's just some extra work and
code to get right.
--
Blake Kaplan
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: User property of a <form> element is not enumerable

by Honza (Jan Odvarko) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Is there a bug filed on this? We can fix it, it's just some extra work and
> code to get right.
Great!

I have reported it here:
https://bugzilla.mozilla.org/show_bug.cgi?id=524423

Honza
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine