mklebel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-17 15:12 UTC
onChange function works great in Firefox, but not in IE
I can''t even get this simple select to alert the value in IE7 or IE6. I''m actually using this select with prototype, but I reduced my code for a more clear explaination. Any ideas?!? <select name="state" onChange="alert(this.value)"> <option value="foo">Foo</option> <option value="foo2">Foo2</option> <option value="foo3">Foo3</option> </select> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brian Williams
2007-Aug-17 15:42 UTC
Re: onChange function works great in Firefox, but not in IE
works in IE 6 & 7 for me... On 8/17/07, mklebel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mklebel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > wrote:> > > I can''t even get this simple select to alert the value in IE7 or IE6. > I''m actually using this select with prototype, but I reduced my code > for a more clear explaination. Any ideas?!? > > <select name="state" onChange="alert(this.value)"> > <option value="foo">Foo</option> > <option value="foo2">Foo2</option> > <option value="foo3">Foo3</option> > </select> > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
onChange fires only if you leave the object (when it looses it''s focus). Could this be your problem? You could try onClick, but then it won''t work when choosing another value via keyboard. Keep in mind, that in XHTML you need all attributes in lower case (onchange instead of onChange). Greetings, Mensler On 17 Aug., 17:12, "mkle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <mkle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I can''t even get this simple select to alert the value in IE7 or IE6. > I''m actually using this select with prototype, but I reduced my code > for a more clear explaination. Any ideas?!? > > <select name="state" onChange="alert(this.value)"> > <option value="foo">Foo</option> > <option value="foo2">Foo2</option> > <option value="foo3">Foo3</option> > </select>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
mklebel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-17 16:01 UTC
Re: onChange function works great in Firefox, but not in IE
tried the onclick, still nothing. I think you are right about it not loosing focus, it looses its focus in Firefox, but it IE it still stays highlighted after I select it, which means it hasn''t lost it''s focus right? On Aug 17, 10:47 am, Mensler <webpl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> onChange fires only if you leave the object (when it looses it''s > focus). > Could this be your problem? You could try onClick, but then it won''t > work when choosing another value via keyboard. > > Keep in mind, that in XHTML you need all attributes in lower case > (onchange instead of onChange). > > Greetings, > Mensler > > On 17 Aug., 17:12, "mkle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <mkle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I can''t even get this simple select to alert the value in IE7 or IE6. > > I''m actually using this select with prototype, but I reduced my code > > for a more clear explaination. Any ideas?!? > > > <select name="state" onChange="alert(this.value)"> > > <option value="foo">Foo</option> > > <option value="foo2">Foo2</option> > > <option value="foo3">Foo3</option> > > </select>--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brian Williams
2007-Aug-17 16:49 UTC
Re: onChange function works great in Firefox, but not in IE
in the past few minutes i''ve discovered with the given original sample above that: IE 6 & 7 and Opera 9.1 fires onchange with the up/down arrows alone firefox 2.0.0.6 up/down arrow and then pressing Enter or moving the focus via tab or mouse clicking somewhere else fires the onchange Safari for windows 3.0.3 fires onchange with enter one time then sends focus somewhere else entirely all work normally via mouse click Some guys here in the office and I think that an onkeyup/press function that tests for up/down arrow can that either calls onchange or simulates pressing enter might be a way to get the same functionality for firefox as in IE or Opera, although thinking about it i''m not sure if there is a way to simulate a keypress. not sure if this will work but maybe onkeyup where it test for up/down which could send the focus to another object and then with that object''s onfocus send it back to the select haven''t tried any of it of course, but it was a 3 minute conversation... On 8/17/07, mklebel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <mklebel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > tried the onclick, still nothing. I think you are right about it not > loosing focus, it looses its focus in Firefox, but it IE it still > stays highlighted after I select it, which means it hasn''t lost it''s > focus right? > > On Aug 17, 10:47 am, Mensler < webpl...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > onChange fires only if you leave the object (when it looses it''s > > focus). > > Could this be your problem? You could try onClick, but then it won''t > > work when choosing another value via keyboard. > > > > Keep in mind, that in XHTML you need all attributes in lower case > > (onchange instead of onChange). > > > > Greetings, > > Mensler > > > > On 17 Aug., 17:12, " mkle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" < mkle...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I can''t even get this simple select to alert the value in IE7 or IE6. > > > I''m actually using this select with prototype, but I reduced my code > > > for a more clear explaination. Any ideas?!? > > > > > <select name="state" onChange="alert(this.value)"> > > > <option value="foo">Foo</option> > > > <option value="foo2">Foo2</option> > > > <option value="foo3">Foo3</option> > > > </select> > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---