radnumerictextbox cannot OnKeypress with Enter key on IE, Chrome

2 posts, 0 answers
  1. balv
    balv avatar
    13 posts
    Member since:
    Apr 2010

    Posted 18 Dec 2012 Link to this post


    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

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 21 Dec 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top