Unhandle exception using enter key with filter in Firefox

1 reply. Last post: December 2, 2013 11:21 PM by Yudi
Tags :
  • (None)

Hi,

We have an issue when we use ApplyFiltersKey="Enter" when there is a button in the same page.

The problem is only there with firefox.

Look at the sample attached, type "s" and press enter in the filter box, you will see an unhandle exception appear.

Regards,

Alex

1 attachment

Answers

Yudi Member

The unhandled exception happen because the form is submitted. If you press Enter key while an input field has focus, the form will be submitted (except for textareas).

The browser, in this case is Firefox, is trying to be a nice guy and click the “ButtonTest” for you, even if you didn’t set it to be the default.

Try to set UseSubmitBehavior property of ButtonTest to false in order to avoid ButtonTest click event got invoked when user press Enter.

<asp:Button ID="_buttonTest" runat="server" Text="ButtonTest" UseSubmitBehavior="false" />

Hope this helps.

All Replies

Yudi Member

The unhandled exception happen because the form is submitted. If you press Enter key while an input field has focus, the form will be submitted (except for textareas).

The browser, in this case is Firefox, is trying to be a nice guy and click the “ButtonTest” for you, even if you didn’t set it to be the default.

Try to set UseSubmitBehavior property of ButtonTest to false in order to avoid ButtonTest click event got invoked when user press Enter.

<asp:Button ID="_buttonTest" runat="server" Text="ButtonTest" UseSubmitBehavior="false" />

Hope this helps.

All times are GMT -5. The time now is 10:21 PM.
Previous Next