I am trying to access a RadDatePicker control from javascript on page load using the code below
The var picker always comes back null so set_selectedDate() does not work. Strange thing is that above this line of code I am getting a reference to a RadComboBox and it works just fine. The combo and the datepicker are pretty much next to one another on the page - same parent containers and all. Here is where I declare the datepicker in HTML.
So far as I can tell I am using the latest version of the controls. What am I missing?
Thanks,
David Martin
[EDIT] My goof. I didn't copy/paste the code above. The code works. My actual code I was using $find as though it were jQuery $() and put a # in front of the ID. Sorry, but sometimes it takes asking the question to wake up the hampster on the wheel.
Sys.Application.add_load(LoadPageData); |
function LoadPageData { |
... |
var picker = $find('<%= _effectiveDate.ClientID %>'); |
picker.set_selectedDate(somedate); |
... |
} |
The var picker always comes back null so set_selectedDate() does not work. Strange thing is that above this line of code I am getting a reference to a RadComboBox and it works just fine. The combo and the datepicker are pretty much next to one another on the page - same parent containers and all. Here is where I declare the datepicker in HTML.
<telerik:RadDatePicker ID="_effectiveDate" runat="server" Width="250px" > |
</telerik:RadDatePicker> |
So far as I can tell I am using the latest version of the controls. What am I missing?
Thanks,
David Martin
[EDIT] My goof. I didn't copy/paste the code above. The code works. My actual code I was using $find as though it were jQuery $() and put a # in front of the ID. Sorry, but sometimes it takes asking the question to wake up the hampster on the wheel.