skip calendar popupbutton on tab

4 posts, 0 answers
  1. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 02 Sep 2011 Link to this post

    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.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Sep 2011 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 02 Sep 2011 Link to this post

    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.
  5. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 06 Sep 2011 Link to this post

    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;

Back to Top