kangax,
knowledge of the tools one have at his disposal is important to be
able to reach the objectives.

It is clear I don't have that knowledge, therefore all those wrong
assumptions.

Thank you for remembering me about the Form.getElements().
(actually you already did it before in another post...my bad). :-)

Diego


On 20 Apr, 16:46, kangax <kan...@gmail.com> wrote:
> On Apr 20, 7:42 am, Diego Perini <diego.per...@gmail.com> wrote:
>
> > kangax,
> > you showed how to correctly use a context in Prototype selectors and
> > still perform fast (without repeating the context).
>
> > Another problem, from what I understand, is that this will only work
> > if the user doesn't care about the order of elements being returned or
> > if the order is known beforehand so the select can be written
> > accordingly.
>
> Yes. Prototype's selector doesn't ensure proper order of elements
> (with complex selectors) and only does so coincidentally when
> `document.querySelectorAll` is being used.
>
>
>
> > Order will be important if the user need to serialize form elements,
> > also there exists methods in Prototype to do that, I just didn't know
> > what was the final objective of the OP.
>
> It should be possible to do so with `Form.getElements` which relies on
> `getElementsByTagName("*")`
>
> $(someForm).getElements().findAll(function(el){
>   return el.descendantOf(someElement);
>
> });
>
> [...]
>
> --
> kangax
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
prototype-core-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to