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

[Solved] Standard JQuery 'change' event not firing in IE

4 Answers 146 Views
NumericTextBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nicholas
Top achievements
Rank 1
Nicholas asked on 21 Jun 2011, 10:14 PM
We are using a number of Telerik MVC NumericTextBox controls within our solution. On a particular page we have needed to use the JQuery change event handler for the numeric text box's input field rather than the OnChange event provided by Telerik. The reason for this is that each row in our table has repeated text boxes, the change events are registered and maintained using a custom jquery plugin. We have bound the events as per the example on the forum post http://www.telerik.com/community/forums/aspnet-mvc/numericinput/subscribing-to-onchange-in-javascript.aspx which works in Firefox and Chrome, however, in IE the even never fires.
Example page is as follows (this works in Firefox but not IE - any assistance would be greatly appreciated)

Telerik MVC v2011.1.315
@(Html.Telerik().NumericTextBoxFor(m => m.Number))
 
@{Html.Telerik()
      .ScriptRegistrar()
      .OnDocumentReady(
        
      @<text>
 
      $('#Number').bind('change', function() {
        alert('number on change event fired');
      });
 
    </text>);
}

4 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 22 Jun 2011, 11:37 AM
Hello Nicholas,

 
Currently, the numerictextbox component prevents DOM change event of the input.
We will address this limitation with the next official release of Telerik extensions for ASP.NET MVC scheduled for the middle of July.

Regards,
Georgi Krustev
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
0
Nick
Top achievements
Rank 1
answered on 30 Aug 2011, 11:00 PM
Has this issue been addressed in the latest version? If so, can you please provide some sample code for DOM change event of the input?
Thanks
0
Georgi Krustev
Telerik team
answered on 31 Aug 2011, 09:53 AM
Hello Nick,

 
The issue was addressed in the Q2 2011 release of Telerik Extensions for ASP.NET MVC. You can wire the DOM change event using this code snippet:

<%= Html.Telerik().NumericTextBox()
        .Name("NumericTextBox")
        .Spinners(Model.NumericShowSpinners.Value)
        .MinValue(Model.NumericMinValue.Value)
        .MaxValue(Model.NumericMaxValue.Value)
%>
 
<%
    Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>
    {
        %>
            $("#NumericTextBox").bind({
                change: function() {
                    console.log("DOM change");
                },
                valueChange: function(e) {
                    console.log("Numeric event: " + e.newValue);
                }
            });
        <%
    });   
%>

Please note that the DOM change event will be raised only when end user modify the input content. If you need to handle value changing when Up/Down arrow is clicked I will suggest you wire "valueChange" event which is the change event of the NumericTextBox component.

Regards,
Georgi Krustev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Nick
Top achievements
Rank 1
answered on 31 Aug 2011, 08:53 PM
Thanks for the fast reply. I updated to the latest version, and binding the valueChange event works perfectly.
Tags
NumericTextBox
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Nick
Top achievements
Rank 1
Share this question
or