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

DatePicker focuses on hidden shared calendar when picking a date. How to stop?

1 Answer 34 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Fred
Top achievements
Rank 1
Fred asked on 15 Jun 2009, 03:18 PM
I did a search on focus and found two articles, but they don't seem to apply 100%

http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatepicker-validation.aspx
and 
http://www.telerik.com/community/forums/aspnet-ajax/calendar/set-focus-after-date-selected.aspx

Both of these, it's a single DatePicker choosing a date and getting focus back.

I have about 30 dates on the page all using a hidden SharedCalendar at the top. When a user selects the date, they are sent to the top of the page.

Is there a way on the SharedCalender to send the focus back to the DatePicker that called it? Or do I need to set something on every DatePicker?

Was thinking something like..

 <telerik:RadCalendar ID="calShared" runat="server" EnableMultiSelect="false" ClientEvents-OnDateSelected="ResetFocus" />


 function ResetFocus(sender, args) {

                //sender.focus();

            } 

but that didn't work.

1 Answer, 1 is accepted

Sort by
0
Accepted
Veli
Telerik team
answered on 17 Jun 2009, 12:32 PM
Hello Fred,

You are in the right direction. Try this:

<telerik:RadDatePicker ID="RadDatePicker1" runat="server"
    <ClientEvents OnDateSelected="focusPicker" /> 
</telerik:RadDatePicker> 

function focusPicker(sender, args) 
    sender.get_dateInput().focus(); 

Attaching the picker OnDateSelected client-side event to this method should work no matter how many date pickers you have on your screen.

Kind regards,
Veli
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.
Tags
Calendar
Asked by
Fred
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or