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

OnChange event of Decorated SELECT does not fire

5 Answers 116 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Tele
Top achievements
Rank 1
Tele asked on 15 Apr 2011, 09:47 AM
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.

5 Answers, 1 is accepted

Sort by
0
Niko
Telerik team
answered on 15 Apr 2011, 12:44 PM
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.
0
Tele
Top achievements
Rank 1
answered on 18 Apr 2011, 09:09 AM
Thanks for your reply. The $addHandler worked fine.
0
Tele
Top achievements
Rank 1
answered on 02 Feb 2012, 09:16 AM
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.
0
Niko
Telerik team
answered on 02 Feb 2012, 10:57 AM
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.
0
LevizArc
Top achievements
Rank 1
answered on 02 Feb 2012, 02:31 PM
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
Tags
FormDecorator
Asked by
Tele
Top achievements
Rank 1
Answers by
Niko
Telerik team
Tele
Top achievements
Rank 1
LevizArc
Top achievements
Rank 1
Share this question
or