<script type="text/javascript" src="cropper/lib/prototype.js"></script>
<script language="JavaScript"><!--
function handler(e) {
if (document.all) { e = window.event; }
var key;
if (document.layers) key = e.which;
if (document.all) key = e.keyCode
alert('Unicode value of key pressed was ' + e.keyCode);
}
window.onload = function(){ Event.observe($('testselect'), 'keypress',
handler);}
//--></script>
<form>
Inline: <input type="text" onKeyPress="handler()">
Observing: <input id="testselect" />
</form>
Let's say, I press an "s" key. In the first, inline event, it alerts
keyCode 115 =s. Doing the same in the observed input it alerts keyCode
83=S. Somehow the Event.observer capitalizes the character. (and it
gets a bit wild with special characters from numlock etc.)
Does anyone now how to make Event.observer return the correct value?