Oct 30, 2003 #1 kenjoswe Technical User Sep 19, 2000 327 SE Hi all, How can I get the 'Enter' button to behave the same way as the 'Tab' button on a Web-Form? /Kent J.
Hi all, How can I get the 'Enter' button to behave the same way as the 'Tab' button on a Web-Form? /Kent J.
Oct 30, 2003 1 #2 vbkris Programmer Jan 20, 2003 5,994 IN u have to write a code that will capture the KeyCode, try this for a start: <input type="text" onkeydown="alert(event.keyCode())"> this will give a series of ascii values, capture the value of enter and do whatever u wanna do... Known is handfull, Unknown is worldfull Upvote 0 Downvote
u have to write a code that will capture the KeyCode, try this for a start: <input type="text" onkeydown="alert(event.keyCode())"> this will give a series of ascii values, capture the value of enter and do whatever u wanna do... Known is handfull, Unknown is worldfull
Oct 31, 2003 Thread starter #3 kenjoswe Technical User Sep 19, 2000 327 SE vbkris, Thanks! But I get a script error: ... Error: 'The object cannot handle this action' Code: 0 ... Upvote 0 Downvote
vbkris, Thanks! But I get a script error: ... Error: 'The object cannot handle this action' Code: 0 ...
Oct 31, 2003 #4 tsuji Technical User Jul 25, 2001 10,675 US Hello kenjoswe, Try take out the (). Code: <input type="text" onkeydown="alert(event.keyCode)"> regards - tsuji Upvote 0 Downvote
Hello kenjoswe, Try take out the (). Code: <input type="text" onkeydown="alert(event.keyCode)"> regards - tsuji
Oct 31, 2003 #5 vbkris Programmer Jan 20, 2003 5,994 IN ah, sorry... Known is handfull, Unknown is worldfull Upvote 0 Downvote
Nov 3, 2003 Thread starter #6 kenjoswe Technical User Sep 19, 2000 327 SE OK! Great! Thanks to you! /Kent J. Upvote 0 Downvote
Nov 3, 2003 Thread starter #7 kenjoswe Technical User Sep 19, 2000 327 SE But how can I convert keycode=13 (Enter) to keycode 9 (Tab)? /Kent J. Upvote 0 Downvote
Nov 3, 2003 #8 vbkris Programmer Jan 20, 2003 5,994 IN dont convert, if(keycode==13) { document.Form.TextFieldToBeGivenFocus.focus() } Known is handfull, Unknown is worldfull Upvote 0 Downvote
dont convert, if(keycode==13) { document.Form.TextFieldToBeGivenFocus.focus() } Known is handfull, Unknown is worldfull
Nov 5, 2003 #9 173234 Programmer Mar 13, 2002 8 US You may also want to try this... window.document.onkeydown = convertEnterToTab; function convertEnterToTab() { if (window.event.keyCode == 13) { window.event.keyCode = 9; } } Upvote 0 Downvote
You may also want to try this... window.document.onkeydown = convertEnterToTab; function convertEnterToTab() { if (window.event.keyCode == 13) { window.event.keyCode = 9; } }