var key;
if(window.event)
key=window.event.keyCode;
else
key=e.which //for firefox explicitly on XPages
But the same failed in case of XPages in Firefox and I was puzzled
After a long try I found the following fix which worked for client, web-IE/Firefox/Chrome. The trick is bolded in the following code
var key;
if(window.event)
key=window.event.keyCode;
else
key=thisEvent.which //for firefox explicitly on XPages
//if enter key is pressed proceed or else skip
if (key == '13') {
alert("Enter Key Pressed");
}
Hope this helps :)
Both code snippets seem the same?
ReplyDeleteThanks for pointing it out..
ReplyDeleteSorry about the typo, have changed it