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

onchange not raised when dateinput gets date after selection from calandar

2 Answers 199 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Roger Manderville
Top achievements
Rank 1
Roger Manderville asked on 01 Dec 2008, 08:04 PM
Hi,

I am tring to call a javascript function when a date is selected using the date picker. I am using the onchange event of the embedded DateInput control. When I type in a date this works fine. When I select a date from the calendar, the onchange event is not being raised. Should I not expect the onchange event to be raised when the date is set using the calendar? If not, what event would I use?

Thank You.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Dec 2008, 06:16 AM
Hi Roger Manderville,

I guess you want to call a JavaScript function on selecting the date from RadDatePicker. You can call the JavaScript on OnDateSelected="ondateselected" event of RadDatePicker to achieve this.

ASPX:
<telerik:RadDatePicker ID="RadDatePicker1" Runat="server"
            <ClientEvents OnDateSelected="OnDateSelected"/>             
</telerik:RadDatePicker> 

JavaScript:
<script type="text/javascript"
function OnDateSelected() 
    //statements 
</script> 

Thanks,
Shinu.
0
Roger Manderville
Top achievements
Rank 1
answered on 03 Dec 2008, 04:45 PM
Hi Shinu,

Actually, I am calling local web services as described in the article below:

http://asp.net/ajax/documentation/live/tutorials/ExposingWebServicesToAJAXTutorial.aspx

I construct the web service call dynamically in code and then assign the call using attributes.add (for the standard controls). I also allow the programmer to pass in javascript code to be executed before the call and after. 

With the date picker I am using ClientEvents.OnDateSelected and assigning the web service call to this property but I get the following error:

Microsoft JScript runtime error: Sys.InvalidOperationException: Handler must be a function.

Any ideas?

thanks,
Roger
Tags
Calendar
Asked by
Roger Manderville
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Roger Manderville
Top achievements
Rank 1
Share this question
or