Thought I fixed a search page issue...

Apr 3, 2008 at 4:49 PM
I came across some issues today with the search.aspx page and thought I would share. This issue stemmed from the form not working when submitting via the enter key.

After finally figuring out that the form was submitting both the HTML search form AND the .Net form, I tried to find the .Net form onsubmit code, I knew in the compiled page is was like so,
<form name="aspnetForm" method="post" action="/search.aspx" id="aspnetForm">
but I couldn't find where this was built.

So as a little workaround I just added a little line in the SearchPage() function
event.keyCode = 9;
This switches the keycode from enter (13) to tab (9), Now when it finishes the search and goes back to the page, the asp.Net form wont catch the enter key, therefore stopping it from submitting.

Just thought I'd share!
Apr 3, 2008 at 4:55 PM
Well, looks like I was a little premature in posting this, it doesn't work in Firefox.

Anyone know how to stop it submitting the aspnetForm?