Hi, I''ve been using prototype for some time now and have recently found a strange issue. I have a page with an hidden input field with name "menu" and another DIV with id "menu". When i do the usual $("menu") i get the hidden field with name "menu" in IE (work fine in FF). If I remove the name att from the hidden input field, the $("menu") returns the correct DIV, as expected. Any ideas as of why?? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matth wrote:> Hi, > > I''ve been using prototype for some time now and have recently found a > strange issue. I have a page with an hidden input field with name > "menu" and another DIV with id "menu". When i do the usual $("menu") i > get the hidden field with name "menu" in IE (work fine in FF). If I > remove the name att from the hidden input field, the $("menu") returns > the correct DIV, as expected. > > Any ideas as of why??It is an IE "feature" that document.getElementById() will grab both names and ids. It is recommended to ensure name and id attributes are unique unless the id and name are attributes of the same node. - Ken Snyder --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
IE incorrectly returns elements by name as well as by id, I''d recommend either changing your id (or your name) Gareth On 11/30/07, Matth <mreichenbach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > > I''ve been using prototype for some time now and have recently found a > strange issue. I have a page with an hidden input field with name > "menu" and another DIV with id "menu". When i do the usual $("menu") i > get the hidden field with name "menu" in IE (work fine in FF). If I > remove the name att from the hidden input field, the $("menu") returns > the correct DIV, as expected. > > Any ideas as of why?? > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Crap! thnks a lot On Nov 29, 2:10 pm, Ken Snyder <kendsny...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Matth wrote: > > Hi, > > > I''ve been using prototype for some time now and have recently found a > > strange issue. I have a page with an hidden input field with name > > "menu" and another DIV with id "menu". When i do the usual $("menu") i > > get the hidden field with name "menu" in IE (work fine in FF). If I > > remove the name att from the hidden input field, the $("menu") returns > > the correct DIV, as expected. > > > Any ideas as of why?? > > It is an IE "feature" that document.getElementById() will grab both > names and ids. It is recommended to ensure name and id attributes are > unique unless the id and name are attributes of the same node. > > - Ken Snyder--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---