Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the focus to a button on pressing the "enter" key in the key board

i have a aspx page with two buttons,"close" and "submit" button.when i press the enter key in the keyboard the focus automatically goes to "close" button and closes the page.Instead i want the focus to be focused on the "submit" button on pressing the enter key in the keyboard.

like image 565
subash Avatar asked May 24 '10 09:05

subash


1 Answers

Set defaultbutton property on your frame:

<form id="form1" runat="server" defaultbutton="btnID">

http://forums.asp.net/t/985791.aspx

like image 57
mamoo Avatar answered Oct 19 '22 23:10

mamoo