Is it possible to have focus events bubble in protoype?
I am trying to prevent having to assign an observer on every input element.
You can use this :
function focusInHandler(event){
Event.element(event).fire("focus:in");
}
function focusOutHandler(event){
Event.element(event).fire("focus:out");
}
if (document.addEventListener){
document.addEventListener("focus", focusInHandler, true);
document.addEventListener("blur", focusOutHandler, true);
} else {
document.observe("focusin", focusInHandler);
document.observe("focusout", focusOutHandler);
}
document.observe('focus:in', function(event) {
// Your code
});
My jsFiddle : http://jsfiddle.net/EpokK/k7RPE/3/