onkeyup handler not being called
pI found a post on SO that was actually posted yesterday (I cannot find it
now) that says my code below should work, but it does not -- the
'handleRtnKey(e)' function below is never called - why?/p precodelt;input
type=text id=zer onkeyup=handleRtnKey(e)/gt; // my javascript function --
by the way, I will not be using jquery. function handleRtnKey(e) {
alert(Just entered handleRtnKey()); if (!e) { e = window.event; // resolve
event instance for IE } alert(Just entered handleRtnKey(), e.keyCode is: +
e.keyCode); alert(Just entered handleRtnKey(), e is: + e); if (e.keyCode
== '13') { //alert(this.value); alert(handleRtnKey: got the RTN key up
event.); return false; } } /code/pre pNone of the alerts fire./p pI found
a SO post from yesterday that had this near exact code (without my alerts)
that claimed to work fine (sorry I cannot re-find that SO post)./p pI need
to use straight javascript (not jquery) to get the key code of the keyup
event in my input text box -- that's all I need to do, and if it is the
Return key, then I'll take some action, but for now I cannot get the above
code to fire that handleRtnKey() function -- why?/p
No comments:
Post a Comment