Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7048543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:54:17+00:00 2026-05-28T02:54:17+00:00

I asked the following in an old question : I’m using the timepicker plugin

  • 0

I asked the following in an old question:

I’m using the timepicker plugin for jquery. once users selected a date+time and click on the “Done” button, which basically just closes the dialog, i want the textbox where datetime is set to gain back focus (the current behavior of the plugin is to blur out focus). This is because on this page i have a set of textboxes and their tab orders are set sequentially. i need the datetime textbox to gain back focus to continue the tab order. otherwise the tab order will restart from the first text input which is inconvenient for the user.

I got back a working answer below

$('#MyDatepicker').datetimepicker({
   onClose: function(dateText, inst) {
     $('#MyDatepicker').focus();
  }
});

but this is my new challenge: now the textbox has its focus back, the calendar opens again. how do i prevent that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:54:17+00:00Added an answer on May 28, 2026 at 2:54 am

    So I was thinking about this one over the weekend after messing around with trying to get it to work, when I realized that maybe the best behavior is not to set focus back at all! Thinking about your users, once they have explicitly selected a date, why would they want focus back on the same field? So instead set focus to the next input.

    http://jsfiddle.net/QwQwN/

    $(function() {
        $(".date").datepicker({ });
    });
    
    $('.date').change( function() {
        $(this).nextAll('input:first').focus();
    });
    

    I tried using the onClose events of the date picker, but changing focus midstream broke the plugin. I dont think this is possible without modifying the actual plugin code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

yesterday I just asked following question. How to customize tableView Section View - iPhone
Recently I was asked the following question at interview. What are the different way
A friend of mine was asked the following question today at interview for the
Following on from the question asked by Mykroft Best way to handle input from
My friend was asked the following question: what's the difference between object language and
I was asked the following question in an interview: Is there any way in
Following on from another question I have asked I have created a new class
I was asked the following Question: How would you store the data given below(which
I have been asked the following question a couple times and feel like I
Marvin Minsky asked me the following question during my oral exam: As an ant

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.