This is a migrated thread and some comments may be shown as answers.

radnumerictextbox cannot OnKeypress with Enter key on IE, Chrome

1 Answer 70 Views
Input
This is a migrated thread and some comments may be shown as answers.
balv
Top achievements
Rank 1
balv asked on 19 Dec 2012, 05:55 AM

Hi everybody,
I have issue with Enter key pressed on radnumerictextbox. This key is not handled by OnKepPress event  in clientevents with IE9 and Chrome 23 (only work fine in firefox)
Is there any workaround to have Enter key handled by RadNumericTextBox in IE and Chrome?
I use Telerik version 2012.1.411.35

--------Control-------

<telerik:RadNumericTextBox ID="zoomNumber" runat="server" Height="25" Type="Number"
                                                AutoPostBack="False" ShowSpinButtons="True" Width="55px" MaxValue="400" MinValue="25"
                                                Value="100" Enabled="True" ReadOnly="False">
                                                <NumberFormat DecimalDigits="0"></NumberFormat>
                                                <IncrementSettings Step="8" InterceptMouseWheel="False"></IncrementSettings>
                                                <EnabledStyle ForeColor="#FFFFFF" BackColor="#215C7A" BorderColor="#333333" HorizontalAlign="Right" />
                                                <ClientEvents OnValueChanged="zoomChanged" OnValueChanging="zoomChanging" OnKeyPress="onNumericKeyPress"></ClientEvents>
                                            </telerik:RadNumericTextBox>

---------Javascript-------------

  function onNumericKeyPress(sender, args) {
        if (sender != null) {
            if (args.get_keyCode() == 13) {
                sender.set_value(parseFloat(sender.get_editValue()));
            }
            var c = args.get_keyCode();
            if ((c < 48) || (c > 57))
                args.set_cancel(true);
        }
    }


Best regards,
Ba

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Dec 2012, 01:57 PM
Hello Ba,

I have created a sample RadGrid web site to test the described behavior. On my side everything works as expected and the event fires correctly. Could you please check out the attached application and verify that it fires properly?

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Input
Asked by
balv
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or