Eu escrevi uma function cross-browser para atribuir eventos
O problema é que utilizando o addEventListener o return que é feito pelo método não é propagado pra fora.
alguem ?!
function addEvent(input, eventNameWithOutOn, target) {
try {
input.addEventListener(eventNameWithOutOn, target, true);
} catch(ex) {
input.attachEvent('on'+eventNameWithOutOn, target); // ie suX!
}
}
function isNumero(theEvent) {
var code = (window.event) ? theEvent.keyCode : theEvent.which; // cross-browser code
if(code >= 48 && code <= 57)
return true;
return false;
}