OnValueChanged and more then one handler

2 posts, 0 answers
  1. Anatoly
    Anatoly avatar
    14 posts
    Member since:
    May 2008

    Posted 28 Jul 2008 Link to this post

    Hi,
    How to add more then one handler to OnValueChanged client event?
  2. Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 29 Jul 2008 Link to this post

    Hi Anatoliy,

    You can use the add_[event] method to add an event handler to the element that exposes the event. The eventName parameter should not include the "on" prefix. For example, specify "valueChanged" instead of "onValueChanged".


    Here is an example:

            <div> 
                <script type="text/jscript"
                function pageLoad(sender, args) 
                { 
                    $find("RadTextBox1").add_valueChanged(handler_1); 
                    $find("RadTextBox1").add_valueChanged(handler_2); 
                } 
                 
                function handler_1(sender, args) 
                { 
                    alert("handler_1"); 
                } 
                 
                function handler_2(sender, args) 
                { 
                    alert("handler_2"); 
                } 
                </script>         
                <telerik:RadTextBox ID="RadTextBox1" runat="server"
                </telerik:RadTextBox> 
            </div> 



    Regards,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top