Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Submit form when Enter is pressed

I have an aspx page with many buttons and i have a search button whose event i want to be triggered when user press enter. How can i do this?

like image 703
Jishnu A P Avatar asked Dec 22 '10 10:12

Jishnu A P


2 Answers

You set the forms default button:

<form id="Form1"
    defaultbutton="SubmitButton"
    runat="server">
like image 120
m.edmondson Avatar answered Oct 12 '22 10:10

m.edmondson


Make it the default button of the form or panel.

Either one has a DefaultButton property that you can set to the wanted button.

like image 29
Oded Avatar answered Oct 12 '22 11:10

Oded