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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:11:44+00:00 2026-06-08T01:11:44+00:00

In my html I have two different datepickers, inside two different divs. I want

  • 0

In my html I have two different datepickers, inside two different divs. I want to do something when selecting a day from the datepicker, like this:

$('#details1 tr .ui-body-c').on('click', function(){
    $('#details1 .hasDatepicker').hide();
    if($('#date1').val()!="")
    {
        var day=new Date($('#date1').val());
        day.setHours(23);
        day.setMinutes(59);
        day.setSeconds(59);

        getDayData(day);
    }
});

But clicking on the day is not triggering the click event. If I remove the #details1 from the selector the event triggers, but with both of the datepickers.

Here’s a link to the datepicker plugin: http://jquerymobile.com/demos/1.0a4.1/experiments/ui-datepicker/

EDIT: It seems that the table jquery-mobile datepicker creates is not detected inside the page. I even tried this:

$('html tr .ui-body-c').on('click', function(){
   $('#details1 .hasDatepicker').hide();
    if($('#date1').val()!="")
    {
        var day=new Date($('#date1').val());
        day.setHours(23);
        day.setMinutes(59);
        day.setSeconds(59);

        getDayData(day);
    }
});

And is not working. Also did var a = $('.datepicker-calendar').parent() and got [] as a result.

Any thoughts on why is this happening and how to solve it?

  • 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-08T01:11:46+00:00Added an answer on June 8, 2026 at 1:11 am

    I worked around this by editing the jquery.ui.datepicker.mobile.js file, adding a custom class to elements.

    if(options.altField!=undefined)
        $(dp).attr('id', options.altField.split('#')[1] + '1');
    

    And then in function updateDatepicker(){

    $( ".ui-datepicker-calendar td", dp ).addClass("ui-body-c "+$(dp).attr('id')+'2');
    

    So if my date input’s id is “myDatePicker”, each td on the calendar will have class “myDatePicker12”, and I can do this:

    $('.myDatePicker12').on('click', function(){
       $('#details1 .hasDatepicker').hide();
        if($('#date1').val()!="")
        {
            var day=new Date($('#date1').val());
            day.setHours(23);
            day.setMinutes(59);
            day.setSeconds(59);
    
            getDayData(day);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two different servers and a script like this: echo <div style=\some style\>whatever</div>;
I have two html img objects with different src urls. I'd like to combine
I have an HTML document where I have two different tables. One is class
Lets say there are two pages with two different html elements which have the
I have the exact same html sitting on two different servers. Both pages call
I have two text boxes t1 and t2 in an html page. I'd like
I have build a custom Html Helper extension as follows: public static string DatePicker(this
I have two XML sources to retrieve data from. I want to use them
I have two divs for different sections of my webpage, a working and a
I have two datepickers with different id and name. Can I merge them both

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.