Click to See Complete Forum and Search --> : Desiable keyCoder (9)Tab


NeoNmaN
06-13-2006, 05:30 AM
i can't get my Tab key desiable.


function checkKeycode(e)
{
var keycode;

if (window.event)
keycode = window.event.keyCode;

else if (e)
keycode = e.which;

if(keycode == 9){
document.getElementById('test4').focus()
}

}


I hob sombardy can help me i hav this problem all day...

phpnovice
06-13-2006, 07:36 AM
onkeydown="
var key = (window.Event) ? event.which : event.keyCode;
if(key == 9){
document.getElementById('test4').focus();
if(window.Event) event.which = 0;
else event.keyCode = 0;
return false;
}
return true;"

NeoNmaN
06-13-2006, 07:41 AM
Thanks :) and in function? for that code working ;) bot i can't crate a function whit taht ;) can you help me whit that?

phpnovice
06-13-2006, 08:13 AM
The key to using a separate function is the argument shown in red:

onkeydown="return RedirectFocusOnTab('test4', event)"
function RedirectFocusOnTab(id, e) {
var key = (window.Event) ? e.which : e.keyCode;
if(key == 9){
document.getElementById(id).focus();
if(window.Event) e.which = 0;
else e.keyCode = 0;
return false;
}
return true;
}

NeoNmaN
06-13-2006, 08:36 AM
Relly tanks :) ist working ;) doe you hav gtalk i can have?

phpnovice
06-13-2006, 09:23 AM
I don't know what you mean. However, I presume you're referring to some kind of direct communication other than the forum. Well, the forums are for free. Anything else will cost you money.

Cheers.