Home | Articles|Namespace|Interview Questions|Tools|Jobs|Projects|Community
Asp.net Tutorials

»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»



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
posted by:Nathan  on 5/8/2007 12:00:00 AM
© 2008 dotnetwatch.com -- Privacy policy

Website Design & Internet Marketing by Shivam