|
Rank: Advanced Member Groups: Member
Joined: 9/18/2007 Posts: 38
|
the question is in the title
I can set the calendar (actually datepicker) date to the clients date easily after the page is posted back once, but to do it on page load is really causing me some head banging
been running variants of this command client side (in javascript)
eo_GetObject(<% = calday.ClientID %>).setSelectedDate(new Date());
where calday is the server ID of the object
the issue seems to be that the control doesn't exist during the initial page load - have tried all kinds of stuff even calling it from the clientsideonload property but I always get an error basically saying the control doesn't exist yet. Like I said if I replicate the code on a postback it works fine, but I need to set this value when the page loads
help would be appreciated
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, Please try to handle the Calendar's ClientSideOnLoad event and then set it inside that event handler. It will be something like this:
Code: HTML/ASPX
<eo:Calendar .... ClientSideOnLoad="calendar_on_load" ...>
....
</eo:Calendar>
Code: JavaScript
function calendar_on_load()
{
eo_GetObject(<% = calday.ClientID %>).setSelectedDate(new Date());
}
Please let us know if this works for you. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 9/18/2007 Posts: 38
|
as I mentioned in my original post - I did try this method and I still get an error saying the object passed to eo_GetObject is null - in essence the calday control doesn't yet exist
any other help would be appreciated
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
Sorry that I missed that you have already tried ClientOnLoad. ClientOnLoad should work because it is only fired after the Calendar has been loaded. If that still does not work, please try to isolate the problem into a test page and we will be happy to take a look.
Thanks!
|
|