By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,177 Members | 665 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,177 IT Pros & Developers. It's quick & easy.

please anybody help to solve keydown event for enter button problem

P: 7
Hi,


I am working in asp.net with C# web application, i have used one textbox and image button for search

funtion, i have created one user control for this, but after i have entered value in textbox, i have pressed the

button, its not at all working, if i will use mouse i can able to search values, how to enable to enter key at

keydown event of textbox, the following script i have used ,


function Buttonfocus()
{
if(event.which || event.keyCode)
{
if ((event.which == 13) || (event.keyCode == 13) || (event.which == 10) || (event.keyCode == 10))
{
document.getElementById("go").click();
return false;
}
}
else
{
return true;
}
}

Please anybody to help me solve this problem in my application, advanced thanks for any reply.

Thanks.
Mar 8 '07 #1
Share this Question
Share on Google+
1 Reply

acoder
Expert Mod 15k+
P: 16,027
See this page for a cross-browser way of accessing event properties.

You need to have an argument in the function for this to work in all (most) browsers.
Mar 8 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.