Firefox doesn’t respond to Enter Key in SharePoint Search Box 7

Stumbled across a funny little problem with SharePoint and Firefox today. Turns out that with some master pages, Firefox has a problem responding to the “enter key” when using the SearchBoxEx control. In these cases, hitting enter just refreshes the page. I only noticed it because a recent client wanted to hide the Search button. So, it turns out that this problem is actually solved in default.master where Microsoft use two unassuming lines of uncommented code:

<input type="text" name="__spDummyText1" style="display:none;" size=1/>
<input type="text" name="__spDummyText2" style="display:none;" size=1/>

All you have to do is add these two lines to your custom master page anywhere before the final

tag.

Thanks to SteveNG for the blog post that solved this for me.

7 thoughts on “Firefox doesn’t respond to Enter Key in SharePoint Search Box

  1. Reply the photoSmith Aug 3,2009 6:33 pm

    wow, never even knew this was an issue, thanks! i’ll add this to my master page right away.

  2. Reply Alissa Sep 19,2009 7:20 am

    Thanks for sharing this information with all of us.

  3. Reply asembler Oct 2,2009 1:16 am

    Exactly what I was looking for. Thank you.

  4. Reply asembler Oct 15,2009 11:19 pm

    I implemented your suggestion in my master page and it has NOT solved the problem of Enter not being recognized in firefox. 🙁

  5. Reply Randy Drisgill Oct 15,2009 11:36 pm

    Too bad asembler, worked for me just fine. Glad to see you got it fixed though.

  6. Reply Michael Hein Feb 6,2012 10:16 am

    Remember, if your search results page has any buttons on it (i.e. we have a couple of custom controls on the page footer) make sure you set

    UseSubmitBehavior = false;

    This prevents the submit event firing which is attached to the button.

Leave a Reply