views:

30

answers:

0

I'm trying to suppress the normal keyboard events on Firefox's interpretation of the <select multiple="multiple"> box, but the methods I'm used to aren't working. YUI's stopEvent doesn't seem to actually suppress the effects of a keypress or keydown (or both).

keyPressHandler = function (e) {
    YUE.stopEvent(e);
};
YAHOO.util.Event.addListener(element, 'keypress', keyPressHandler)
YAHOO.util.Event.addListener(element, 'keydown', keyPressHandler)

Assuming element is a selectbox, the keyboard it still usable to navigate the selectbox in Firefox, however it is not in Chrome. Any ideas on how to properly suppress keyboard events in Firefox?

I generally don't step outside the bounds of YUI but if there is another solution I'm open to it.