I'm using a script which works in Firefox, but not so much in IE that allows "keyboard shortcuts" on the page. So if the user presses "s" it takes them to the search box on the page to do a search. Only problem is i get a JS error in IE that says 'keyCode' is null or not an object.
Any ideas?
_______________
_brian.
Code:
function sendToSearch(e) {
if (e.keyCode) {
keycode=e.keyCode;
} else {
keycode=e.which;
}
character=String.fromCharCode(keycode);
if(keycode == "83" || keycode == 83 || character == "s"){
document.forms['search_box'].elements['search'].focus();
}
}
document.onkeypress = sendToSearch;
_______________
_brian.