How can a button be de-prioritized so it is 'skipped' as the page's default button?

sohbet

New Member
I have a complex web app with hundreds of controls, dozens of pages and about a dozen masterpages. Using ContentPlaceHolders, different form content is generated within the main body of each page, such as a login prompt on one page and 'add to favorites' button on another.Common to all of these pages is a search bar. When the search bar is at the top, it captures the enter key every time the enter key is pressed. If I move the search bar below the main content, through some codebehind and javascript, it correctly captures the enter key only when the search field is in focus.What I'd like to do is leave the search bar at the top of the page, but de-prioritize it so when the enter key is pressed the default button is whatever happens to be second on the page. My aim is to avoid adding javascript to every possible control that could appear in the main body of the page.How can a button be de-prioritized so it is 'skipped' as the page's default button?
 
Back
Top