I am using following code for Date picker but calendar object ($find(<%=RadCalendar1.ClientID%>)) is always coming null. So not able to attach event.
function onDateClickHandler1()
{
alert("First handler called");
}
function pageLoad()
{
var calendar = $find(<%=RadCalendar1.ClientID%>);
calendar.add_dateClick(onDateClickHandler1);
}
{
alert("First handler called");
}
function pageLoad()
{
var calendar = $find(<%=RadCalendar1.ClientID%>);
calendar.add_dateClick(onDateClickHandler1);
}
6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 06 Mar 2009, 04:57 AM
Hi Manoj,
Try putting the RadCalendar.ClientID in " or ' in order to pass it as string. I have tried this example and its is working fine for me.
ASPX:
JavaScript:
Checkout the link Getting the client-side object
Thanks,
Princy.
Try putting the RadCalendar.ClientID in " or ' in order to pass it as string. I have tried this example and its is working fine for me.
ASPX:
<telerik:RadCalendar ID="RadCalendar1" runat="server" Font-Names="Arial, Verdana, Tahoma" |
ForeColor="Black" Style="border-color: #ececec"> |
</telerik:RadCalendar> |
JavaScript:
<script type="text/javascript"> |
function onDateClickHandler1() |
{ |
alert("First handler called"); |
} |
function pageLoad() |
{ |
var calendar = $find("<%=RadCalendar1.ClientID%>"); |
calendar.add_dateClick(onDateClickHandler1); |
} |
</script> |
Thanks,
Princy.
0
Manoj
Top achievements
Rank 1
answered on 06 Mar 2009, 04:11 PM
I am getting following error with this code:
http://tinypic.com/view.php?pic=mw65hj&s=5
0
Shinu
Top achievements
Rank 2
answered on 09 Mar 2009, 04:48 AM
Hello Manoj,
I guess you are using the ASP.NET version of RadControls, not the ASP.NET AJAx version. If so, you can try the following code and see whether its working for you. Could you provide the exact version of RadControls that you are using, in the case of any problem in executing the code?
JavaScript:
Thanks,
Shinu.
I guess you are using the ASP.NET version of RadControls, not the ASP.NET AJAx version. If so, you can try the following code and see whether its working for you. Could you provide the exact version of RadControls that you are using, in the case of any problem in executing the code?
JavaScript:
<script type="text/javascript"> |
function onDateClickHandler1() |
{ |
alert("First handler called"); |
} |
function pageLoad() |
{ |
var calendar = <%=RadCalendar1.ClientID%>; |
calendar.AttachEvent("OnDateClick","onDateClickHandler1"); |
} |
</script> |
Thanks,
Shinu.
0
0
0
Hello Manoj,
Please post a complete web page, so that we can see what exactly are you trying to do and where the problem comes from. Thanks.
Regards,
Dimo
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Please post a complete web page, so that we can see what exactly are you trying to do and where the problem comes from. Thanks.
Regards,
Dimo
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.