Re: [Proto-Scripty] Keypress for html select

2010-05-05 Thread Walter Lee Davis
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

  
   1
   2
   3
   4
   

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 prototype-scriptaculous@googlegroups.com 
.
To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Keypress for html select

2010-05-05 Thread Hari
Hi,

I have a simple html select and attached a javascript to fire an event
when value changes...
My html

   
1
2
3
4


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 prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.