That's not a bug, the API docs are wrong.

.focus() and .select() on form elements are native functions (part of  
the DOM), and don't return the element [1].

always use .activate(), which is defined by Prototype.

Note that i've added tests that chaining works for clear, activate,  
disable and enable in r6146[2].

Anyone up for correcting the docs?

Best,
-Thomas

[1] http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025
[2] http://dev.rubyonrails.org/changeset/6146

Am 10.02.2007 um 15:02 schrieb caillou:

>
> hi there,
>
> i've noticed that both
>     Form.Element.focus('id')
> and
>     Form.Element.select('id')
> return
>     undefined
> even though the api specifies that the element should be given back...
>
> i first noticed that when trying the following example from [1]:
>     $('myelement').focus().select()
>
> i tryed to figure out, where the problem comes from, but i couldn't
> seem to find it.
>
> is this a bug?
>
> my testing environment is prototype 1.5, in FF2.linux and IE6 (under
> wine)
>
> greetz ... caillou
>
> [1] http://prototypejs.org/api/form/element/activate
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to