Onar Vikingstad
2007-Oct-22 23:30 UTC
Form selector is not cross-browser consistent with label elements
I have found that Prototype does not select the same value based on the $F form selector. Consider this HTML snippet: <label for="search">Your query<input name="q" value="" type="text" id="search"></label> Using $F(''search'') returns: - ''''Your query" in Firefox 2 - "Your query" in IE 6 - "" (empty string) in Safari 2 and 3 I don''t know which browser actually does this correctly, but it would be nice if the $F behaved consistently. Isn''t that one of the premises with Prototype to begin with? Btw, document.getElementById(''search'').value returns the same value as the $F selector. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Gareth Evans
2007-Oct-23 00:40 UTC
Re: Form selector is not cross-browser consistent with label elements
This tends to indicate the ''for'' attribute is doubling as id? Odd. On 10/23/07, Onar Vikingstad <vikingstad-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I have found that Prototype does not select the same value based on > the $F form selector. > > Consider this HTML snippet: > <label for="search">Your query<input name="q" value="" type="text" > id="search"></label> > > Using $F(''search'') returns: > - ''''Your query" in Firefox 2 > - "Your query" in IE 6 > - "" (empty string) in Safari 2 and 3 > > I don''t know which browser actually does this correctly, but it would > be nice if the $F behaved consistently. Isn''t that one of the premises > with Prototype to begin with? > > Btw, document.getElementById(''search'').value returns the same value as > the $F selector. > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
kangax
2007-Oct-23 01:04 UTC
Re: Form selector is not cross-browser consistent with label elements
Onar, I''m not sure which version you''re testing against, but $F returns "" (empty string) both in FF and IE for me (against trunk version) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- [prototype] Selector class fails on selector strings with spaces
- RE: Re: form elements in sortable lists
- Cross-Browser History management
- Modal Window Stealing Elements from Form. Need Elegant Solution.
- Attaching event observers to a series of elements - best practice?