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 8908913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:18:14+00:00 2026-06-15T03:18:14+00:00

I have multiple jquery datetimepickers on a page. Trying to set the date on

  • 0

I have multiple jquery datetimepickers on a page. Trying to set the date on ‘Today’ button click but the following sets for all of the datetimepickers on the page?

How do I set only the one that has focus (using Trent Richarsons jquery datetimepicker)?

    $.datepicker._gotoToday = function (id) {
    var inst = this._getInst($(id)[0]),
    $dp = inst.dpDiv;
    this._base_gotoToday(id);
    var tp_inst = this._get(inst, 'timepicker');
    now = new Date();
    var now_utc = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
    this._setTime(inst, now_utc);
    $('.datetime').datepicker('setDate', now_utc);  // <- this woks but sets date for all datetimepickers!  how to I set for current focus datetimepicker
};
  • 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-06-15T03:18:15+00:00Added an answer on June 15, 2026 at 3:18 am

    Use the :focus pseudo-selector, like this:

    $('.datetime:focus').datepicker('setDate', now_utc);
    

    Alternatively you could also give each datepicker an specific id so you can select by it:

    $('#idpicker').datepicker('setDate', now_utc);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to upload multiple images and I have a jquery plugin set
hello im trying to have multiple jquery cycle galleries on one page. ifeel like
I have multiple jQuery accordions on one page all with different id's etc.. I'm
I have multiple iframes on my page and this jQuery replaces them all with
I am trying to have multiple jCarousels on one page: http://abhinavsood.com/labs/jquery/jcarousel-autoscroll-both-directions/test.html - The working
I have multiple ajax forms on page that cointain same elemets, I have jquery
Possible Duplicate: Bind multiple events to jQuery 'live' method I have the following function:
A little new to JQuery, I'm trying to have multiple links that open different
I have found that when multiple jQuery dialogs are open on a page, they
if i have multiple script tags in my page like: <script src=js/jquery-1.7.min.js type=text/javascript></script> <script

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.