OnKeyUp event missing?

6 posts, 1 answers
  1. Jeroen Houba
    Jeroen Houba avatar
    14 posts
    Member since:
    Nov 2004

    Posted 21 Dec 2009 Link to this post

    Hello,

    I am using the Q3 2009 of a RadMaskedTextBox and could not find the OnKeyUp clientside event. It looks like earlier versions of the radinput controls do support this event because it is discussed in this forum.
    The OnValueChanging and OnValueChanged events are triggered when the control loses focus so that is to late for my purpose. So is there any way to handle an event right after a user changes the input by a key press in the latest version?

    Kind regards,

    Jeroen Houba
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8485 posts

    Posted 21 Dec 2009 Link to this post

    Hi Jeroen Houba,

    Indeed, there is OnKeyUp client event handler as part of the control's API, but you can still use the event in the same fashion as with regular textboxes:

    <telerik:RadMaskedTextBox  onkeyup="MyFunctionName()" />


    All the best,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Jeroen Houba
    Jeroen Houba avatar
    14 posts
    Member since:
    Nov 2004

    Posted 21 Dec 2009 Link to this post

    Hello Dimo,

    Thank you for your reply. That will work just fine for me.
    Is there a reason why the onkeyup is not integrated in the API of the control? I would have expected it there.

    Kind regards,

    Jeroen Houba
  4. Dimo
    Admin
    Dimo avatar
    8485 posts

    Posted 21 Dec 2009 Link to this post

    Hi Jeroen,

    I am not sure there is a specific reason for not including the keyup/down events in the API, but generally, they are a lot more rarely used and also, handling them in the same way as keypress might slow down responsiveness in IE.

    Greetings,
    Dimo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Mohamed Bahri
    Mohamed Bahri avatar
    5 posts
    Member since:
    Jan 2010

    Posted 13 Apr 2010 Link to this post

    Hi, I have a issue with the onkeyup event,

    <telerik:RadNumericTextBox ID="TextBox2" runat="server" Type="Number"   
                                NumberFormat-DecimalDigits="0" onkeyup="JS_Recalculate()" > 
                                </telerik:RadNumericTextBox> 

    When the event is fired, (on IE) I get the value prior to the change. For example I have 10 and I add a 0 so I expect to have 100 when the event is fired. Instead I got 10.
    Am I doing something wrong?
    This was working with the asp:Textbox .

    Thanks for your help.
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 16 Apr 2010 Link to this post

    Hello Mohamed,

    I tried the scenario by using get_textBoxValue() method for getting the RadNumericTextBox value and found its working fine. Give a try with this:

    ASP:
    <telerik:RadNumericTextBox ID="TextBox2" runat="server" Type="Number"    
      NumberFormat-DecimalDigits="0" onkeyup="onkeyupEvent()" >  
    </telerik:RadNumericTextBox>

    JavaScript:
    <script type="text/javascript">  
    function onkeyupEvent()  
    {
        var text = $find("<%= TextBox2.ClientID %>").get_textBoxValue();   
        alert (text);   
    }  
    </script>


    Kind regards,
    Maria Ilieva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top