akbash
That was really helpful and I have now got several function keys working in NS, with their default action disabled. This is a signifcant step forward for me and I am most grateful.
Unfortunately, the changes have made my code unuseable in IE as, if I touch any key, IE complains that keyCode is null or not an object A snip of my code is
______________________________
document.onkeypress = keyHit;
if (document.layers) {document.captureEvents(Event.KEYDOWN); F01=112;F03=114;F05=116;F12=123;} else {F01=112;F03=114;F05=116;F12=123;}
function keyHit(event)
{if (event) {thisKey = event.which;} else {thisKey = window.event.keyCode;}
if (event.keyCode == event.DOM_VK_F1) {var buttonname = session + "/BUTTON.999-999=*1"; document.getElementsByName(buttonname)[0].click(); event.stopPropagation(); event.preventDefault();}
}
_________________
I have left out the code for F3, F5, etc. and the code for the buttons.
I am capturing the keys for both NS and IE in "thisKey" and I tried using
"thisKey == F01" instead of
"event.keyCode == event.DOM_VK_F1"
without success.
I need to get it working in IE as I cannot choose which browser will be chosen by my users.
Do you know if it is possible in IE?
Many thanks again for your help
Rob Dixon
PS: BTW, how do you do quotes and code examples on this forum?
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)