Hi, Some more inputs...
- onchange event works fine in IE but not in firefox (doesn't fire a change event when using keyboard to change values). - both onchange and onkeyup events are fired when your event handler has an alert box (you loose focus and an keyboard event with keycode=38 is fired along with onChange event) - note both events are fired only when u have an alert in event handler else only key event is fired... Can someone tell me if this could be done... how can avoid 2 events getting fired and still have alert in my event handler.... Hari On May 5, 6:48 pm, Walter Lee Davis <[email protected]> wrote: > Doesn't the change event fire as soon as the select loses focus and no > longer has the same value it started with? I thought that was the > basis for the event itself. Can you post an example that fails to fire > the change event when modified with the keyboard? > > Walter > > On May 5, 2010, at 8:56 AM, Hari wrote: > > > > > > > Hi, > > > I have a simple html select and attached a javascript to fire an event > > when value changes... > > My html > > > <select id="mySelectBox"> > > <option>1</option> > > <option>2</option> > > <option>3</option> > > <option>4</option> > > </select> > > > My Js > > $('mySelectBox').observe("keyup",myEventHandler); // this is added > > for keyboard support for firefox to recognise selection change using > > keyboard > > $('mySelectBox').observe("change",myEventHandler); // this is the > > actual change > > function myEventHandler(){ > > alert('ping'); > > } > > > If I have both 2 events are fired...If I have either of the two > > statements, things work fine but the other event is not fired. Is > > there a way to get around this problem. > > > Thanks and Regards, > > Hari > > > -- > > You received this message because you are subscribed to the Google > > Groups "Prototype & script.aculo.us" 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 > > athttp://groups.google.com/group/prototype-scriptaculous?hl=en > > . > > -- > You received this message because you are subscribed to the Google Groups > "Prototype & script.aculo.us" 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 > athttp://groups.google.com/group/prototype-scriptaculous?hl=en. -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" 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-scriptaculous?hl=en.
