Very odd event behaviour for onChange on Telerik MVC DatePicker?

Try using e. Value instead as shown in the client-side events example. You are probably using an older version where the value() method returned the previous value during the OnChange event.

Try using e. Value instead as shown in the client-side events example. You are probably using an older version where the value() method returned the previous value during the OnChange event.

UPDATE: "e. Value" means the value field of the OnChange arguments: function onChange(e) { var date = e. Value; // instead of datePicker.value() }.

I see no Razor example using lambda syntax, and I cannot get it working. Could you assist here please? – ProfK Jul 12 '11 at 6:51 Why do you need example with razor syntax - the code is exactly the same.

Simply use the value field of the event argument. Function(e) { var value = e. Value; } – Atanas Korchev Jul 12 '11 at 10:56 I only asked for assistance after trying several times to get the lamba syntax working, and only managing to get the simple, function name argument for events working.

– ProfK Jul 12 '11 at 10:59 So did you try my suggestion or not? To get the value from the event argument of the OnChange event? – Atanas Korchev Jul 12 '11 at 13:31 Yes, thanks, e.

Value works great. – ProfK Jul 12 '11 at 15:12.

As far as the 1 month difference you are getting, that's normal, and it is how the getMonth() method works in javascript on a Date instance: The value returned by getMonth is an integer between 0 and 11. 0 corresponds to January, 1 to February, and so on. So adding +1 is the correct way to cope with the situation, exactly as you did.

Just a little remark about your AJAX call: never hardcode urls. Always use url helpers when dealing with urls: var year = pickedDate.getFullYear(); var month = pickedDate.getMonth() + 1; var day = pickedDate.getDate(); var url = '@Url. Action("Details", "RaceCard")'; $.

Get(url, { year: year, month: month, day: day }, function(result) { // process the results of the AJAX call }).

The x = 1/0 was an oopsie I left behind while trying to get the JS debugger in Chrome to halt. But, you do misunderstand me about the day. The value I'm getting is not just 1 less than when I expect.

When the even fires, it passes me the day value that was on the picker before the new day value is selected. I have tried to make that clear in the example, and even clearer now I have eliminated any chance of my example illustrating a simple off-by-one issue. – ProfK Jul 10 '11 at 12:26 @ProfK, you probably are not calling this RaceDate_onChange method at the right time.It looks like it is called before the actual value changes.

As you haven't shown how and where you have registered this RaceDate_onChange method I don't see how I could help you further. – Darin Dimitrov Jul 10 '11 at 12:28 My code is copy pasted from the Telerik docs for "Subscribing to the OnChange event", except for a name change for the control. I am trying to create condensed example code .

– ProfK Jul 10 '11 at 12:35 Sorry, I did paste the wrong clipboard into my markup example. It's fixed now. – ProfK Jul 10 '11 at 12:45.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions