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

Tab index fails once after selecting date in telerik:RadDatePicker

3 Answers 177 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Mahendra
Top achievements
Rank 1
Mahendra asked on 01 Dec 2014, 10:11 AM
Hi,
  We are using telerik:RadDatePicker for date field, we have a page with multiple input controls and with tab index set to those controls.
When go to RadDatePicker field and after selecting date (using Calendar control), we loose the focus.
Then if we press "tab key", focus move to control with tab index=1, instead of next control.

Refer  attached screenshot, with tab index order (marked inside red color circle).


3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 04 Dec 2014, 09:17 AM
Hello Mahendra,

I have to say that the experienced behavior is expected and is caused by the fact that the focus is lost after a date is selected. In order to avoid this you can focus the control using JavaScript as demonstrated below.

ASPX:
<telerik:RadDatePicker runat="server" ClientEvents-OnDateSelected="dateSelected"></telerik:RadDatePicker>

JavaScript:
function dateSelected(sender, args) {
                var control = sender;
                setTimeout(function () {
                    control.get_dateInput().focus()
                }, 1);
            }

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Mahendra
Top achievements
Rank 1
answered on 04 Dec 2014, 10:49 AM
Hi Angel,
  Thanks for your reply, I have sorted out with below method.

function RadDatePickerSelected(sender, eventArgs) {
var DateCtrl = document.getElementById(sender.get_id() + "_dateInput");
DateCtrl.focus();
}
0
Abdul Moiz
Top achievements
Rank 1
answered on 30 May 2015, 10:27 AM

Hi Petrov,

 Thank you , your solution helped me out of that problem..:)

 Regards,

 Abdul Moiz Ansari.

Tags
Calendar
Asked by
Mahendra
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Mahendra
Top achievements
Rank 1
Abdul Moiz
Top achievements
Rank 1
Share this question
or