OnChange event of Decorated SELECT does not fire

6 posts, 0 answers
  1. Tele
    Tele avatar
    5 posts
    Member since:
    Apr 2011

    Posted 15 Apr 2011 Link to this post

    Hello,

    I have a <select id='selectid'> element that has the "change" event bound
    using $('#selectid').bind('change', select_Changed) or $('#selectid').change(select_Changed).
    The event is fired correctly.

    This control is client side only. It does not have a server id and is not sent through posts.

    As soon as the form is decorated by the Telerik FormDecorator the bound event are
    not fired anymore.

    The original HTML is

    <SELECT id=selectid>
        <OPTION selected>--</OPTION>
        <OPTION value=1>1. first</OPTION>
        <OPTION value=2>2. second</OPTION>
    </SELECT>


    The decorated HTML is :

    <A style="WIDTH: 212px; cssFloat: undefined" id=Skinnedselectid class="rfdSelect rfdSelect_TheSkin" href="javascript:void(0)" unselectable="on" forSelect="selectid">
        <SPAN class=rfdSelectOuter>
            <SPAN class=rfdSelectText>--</SPAN>
        </SPAN>
    </A>
    <SELECT id=selectid class=rfdRealInput _rfddecoratedID="Skinnedselectid" jQuery15104498465490814524="3">
        <OPTION selected>--</OPTION>
        <OPTION value=1>1. first</OPTION>
        <OPTION value=2>2. second</OPTION>
    </SELECT>

    How can I get my events to be fired ?
    Thanks for your help.
  2. Niko
    Admin
    Niko avatar
    387 posts

    Posted 15 Apr 2011 Link to this post

    Hi,

    This is a very interesting case of event handling. The jQuery library handles specific events in a special way, probably trying to escape certain scenarios. The change event, being one of them, is not handled in the traditional way. The FormDecorator attempts to fire this event, however, in IE if the event hasn't been attached the firing doesn't take place.
    To work around this issue I advice you to use the Ajax Toolkit method for attaching event handlers, i.e. $addHandler. Using this method allows the FormDecorator to fire the event handlers correctly.

    Hope this helps.

    Greetings,
    Niko
    the Telerik team
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tele
    Tele avatar
    5 posts
    Member since:
    Apr 2011

    Posted 18 Apr 2011 Link to this post

    Thanks for your reply. The $addHandler worked fine.
  5. Tele
    Tele avatar
    5 posts
    Member since:
    Apr 2011

    Posted 02 Feb 2012 Link to this post

    Hello,

    Back again to the same problem. The addHandler trick work in any browser but IE9....
    Do you have a solution for IE9 ?
    Thanks for your reply.
  6. Niko
    Admin
    Niko avatar
    387 posts

    Posted 02 Feb 2012 Link to this post

    Hi Tele,

    The change event seems to be working just fine in IE9 on my side. Please, check this video to see it for yourself. If you still experience issues, you best option is to open a support ticket and attach a sample runnable project there that demonstrates the issue at hand.

    All the best,
    Niko
    the Telerik team
    Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
  7. LevizArc
    LevizArc avatar
    1 posts
    Member since:
    May 2011

    Posted 02 Feb 2012 Link to this post

    Hi,

    I do agree with you : it is working in IE9.

    Still, I had to upgrade to latest Telerik.Web.UI.dll (2011.3.1305) to make it work,
    because, Telerik.Web.UI.dll (2011.2.915) had the issue,

    Thanks for your help
    Regards
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017