Home
|
Articles
|
Namespace
|
Interview Questions
|
Tools
|
Jobs
|
Projects
|
Community
»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
Forums
»
ASP.NET Forums»
how to activate the button click event when we press the enter button..?
i have created a webpart using VS2003 using C#. i have text box and a button called search. if i click the button then the search operation is activated. but what i need is that if i clck enter button inside the text box the button click event need to be fired. i need to populate this webpart in share point. key press event is not activated. i used web control library template.how can i do it? can any one help me please...
Press Enter to trigger Button Click event
You need to add some javascript to handle this. Try this code. function doSearch(buttonName) { var bool; if(event.keyCode == 13) bool = true; if(bool == true) { document.getElementById(buttonName).click(); return false; } } Then add the following code to the onkeypress event to your textbox. "return doSearch('btnGo')" replace btnGo with the name of your button
ENTER button..?
hi, key press event is not working. how can i solve this problem.
© 2008 dotnetwatch.com --
Privacy policy
Website Design
&
Internet Marketing
by Shivam