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

skip calendar popupbutton on tab

3 Answers 69 Views
Input
This is a migrated thread and some comments may be shown as answers.
Datamex
Top achievements
Rank 2
Datamex asked on 02 Sep 2011, 09:39 AM
Hi!

My customer has a request to skip the calander popupbutton of the datepicker on tab. So if I have 2 datepickers and the textbox of the first datepicker has focus and I press tab, I want the textbox of the second datepicker to get focus. What I've been trying to do so far, is  to trigger a keydown event with the tab key on the focus event of the popupbutton. I was doing this with jquery. But so far it's not working at all.
Do you know how to accomplish this with jquery or javascript?

Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 02 Sep 2011, 10:03 AM
Hello,

You can achieve this by attaching the client event OnDateSelected.
Javascript
function OnDateSelected(sender,args)
 {
   var date = $find('<%= RadDatePicker2.ClientID%>');
   date.get_dateInput().focus();
 }


Thanks,
Princy.
0
Datamex
Top achievements
Rank 2
answered on 02 Sep 2011, 10:30 AM
Hi Princy,

Thanks for your solution. However, I'm searching for a more generic solution because i have to do this with all raddatepickers in my application and the next control isn't always a raddatepicker. In this way i should add a different OnDateSelected event to every raddatepicker.
0
Datamex
Top achievements
Rank 2
answered on 06 Sep 2011, 03:23 PM
I've already found the solution myself. I just set the tabindex of the popupbutton to -1 with some jquery and javascript like this:
var popupButtons = $('a[id*="_popupButton"]');
for (var i = 0; i < popupButtons.length; i++) {
  popupButtons[i].tabIndex = -1;

Tags
Input
Asked by
Datamex
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Datamex
Top achievements
Rank 2
Share this question
or