...

View Full Version : pressing TAB exec function



meos
10-22-2003, 07:07 PM
// i would like to execute function pressing TAB on my form
// it works well in IE, but not in NS6+
// could you add some lines for resolving my problem
// thanks

function ShowTabWnd(srcUrl,obj,w,h) {
if (window.event.keyCode == '9') {
window.open(srcUrl+obj,'_blank','resizable=no,scrollbars=yes,height='+h+',width='+w);
}
}

A1ien51
10-22-2003, 07:13 PM
need to use cross browser code

http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm

Eric

meos
10-22-2003, 07:18 PM
Originally posted by A1ien51
need to use cross browser code

http://www10.brinkster.com/A1ien51/Scripts/KeyCode.htm

Eric

well, i need to pass some arguments too i.e: srcUrl,obj,w,h
if you will so kind & add some lines to my code

glenngv
10-23-2003, 04:51 AM
You need to pass event to the function:

function ShowTabWnd(srcUrl,obj,w,h,evt) {
var code = (window.event) ? window.event.keyCode:evt.which;
if (code == '9') {
window.open(srcUrl+obj,'_blank','resizable=no,scrollbars=yes,height='+h+',width='+w);
}
}

onkeypress="ShowTabWnd(..., ..., ..., ..., event)"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum