samsmithnz Posted February 2, 2004 Posted February 2, 2004 (edited) I'm trying to capture the tab key in my ASP.NET app, I want it to select the first item in the menu. I've added this line to enable my control to recoginise keypresses: txtEmployee.Attributes.Add("onkeyup", "ProcessKeyPress()") and then with the javascript function: function ProcessKeyPress() { var SourceField = event.srcElement; if(event.keyCode == 9) { alert('tab pressed!!!'); } } This captures lots of other keys... (including enter, shirt, ctrl, etc) just not the tab key... it just tabs off the textbox... what can I do? Edited February 2, 2004 by samsmithnz Quote Thanks Sam http://www.samsmith.co.nz
NK2000 Posted February 2, 2004 Posted February 2, 2004 as far as i know is javascript clientside language und asp (active SERVER page) a server sided page.. so you still have to use javascript, java applet, flash, which are all clientsided Quote
samsmithnz Posted February 2, 2004 Author Posted February 2, 2004 as far as i know is javascript clientside language und asp (active SERVER page) a server sided page.. so you still have to use javascript, java applet, flash, which are all clientsided which is what I'm trying to do. Capture the Tab key using javascript, as I said up above. Quote Thanks Sam http://www.samsmith.co.nz
NK2000 Posted February 2, 2004 Posted February 2, 2004 oh i was irritated by " I'm trying to capture the tab key in my ASP.NET app" <script type="text/javascript"> <!-- window.captureEvents(Event.KEYPRESS); window.onkeypress = Input; function Input(event) { alert("You pressed: " + event.which ); } //--> </script> maybe this helps to get the name for tab only Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.