Click here to Skip to main content
15,888,151 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to use enter key to read text box content in asp.net using jquery. I have used the following code to read "id" from the textbox that is being generated runtime:

function showkey(id) {

var keycode = (event.keyCode ? event.keyCode : event.which);
if (keycode == 13) {
alert('You pressed enter key');
}

}


This code is running in chrome and IE but not in firefox.
Please suggest any solution
Posted
Comments
Why don't you debug and see what is the value of key code? See if it 13 or not. Also see if there are any errors listed on browser console.

1 solution

try keyup event instead of keypress event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900