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

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 </form> tag.

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

6 comments:

the photoSmith said...

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

Alissa said...

Thanks for sharing this information with all of us.

asembler said...

Exactly what I was looking for. Thank you.

asembler said...

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

asembler said...

The following page discusses this issue in more detail:

http://blogs.msdn.com/jjameson/archive/2009/10/01/enter-key-does-not-submit-search-in-moss-2007-from-firefox.aspx

Randy Drisgill said...

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