Pressing enter key in "search textbox" doesn't cause submitting

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 years ago
I didn't want the search to be run every time someone typed a letter (that could be a lot of server traffic), so I used this instead:

Search.ascx (search page):

At the top, add:

    <asp:Panel runat="server" ID="pnlSearch" DefaultButton="btnSearch">

right above

    <div class="searchInput">

At the bottom, add:

    </asp:Panel>

right above

    <div class="clear">

The same works for SearchBox.ascx, but put the panel around the <ul></ul> instead.  Hope this helps!
14 years ago
Tested the Search.ascx workaround in v1.3 (it still isn't fixed) and it works a treat.

Thanks!
14 years ago
another way to aceive this is to use a panel with default button set

  <asp:Panel runat="server" ID="pnlSearch" DefaultButton="btnSearch">
        <table width="100%">
            <tbody>
                <tr>
                    <td colspan="2">
                        <asp:TextBox runat="server" ID="txtSearchTerm" Width="100%" SkinID="SearchText"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <br style="line-height: 5px;" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:CheckBox runat="server" ID="chSearchInProductDescriptions" Checked="false" />
                        <%=GetLocaleResourceString("Search.SearchInProductDescriptions")%>
                    </td>
                    <td align="right">
                        <asp:Button runat="server" ID="btnSearch" OnClick="btnSearch_Click" Text="Search"
                            SkinID="SearchButton" />dgdgdg
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <u>
                            <asp:Label runat="server" ID="lblError" EnableViewState="false"></asp:Label>
                        </u>
                    </td>
                </tr>
            </tbody>
        </table>
        </asp:Panel>

Cheers Simon
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.