Is there a way to prioritize which event has priority when using the enter key? What I want is when the focus is on the search box the enter key works the search box...
I've recently enabled Google search on our site. That was quite a struggle since I'm using Master Pages, but I've got that working. The problem is, if there is a form or even a Flash Video on the page, the enter button doesn't work as expected. Even though the focus is on the search, hitting the enter button triggers the form on the page. Or, in the case of a Flash Video, causes the page to refresh and the video to start playing.
Here's the code I'm using to capture the enter key for the search box. It works fine on pages where there is no other submit_Click event or Flash content.
// Retrieved from: http://www.htmlcodetutorial.com/forms/index_famsupp_157.html
function SubmitOnEnter(myfield, e)
keycode = window.event.keyCode;
else if (e)
keycode = e.which;
if (keycode == 13)
Sorry for the complexity of the question but that's what's happening...