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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:09:17+00:00 2026-06-06T11:09:17+00:00

I need to do simple task : show 2 datepickers : one – by

  • 0

I need to do simple task :

show 2 datepickers :

one – by month and year , seocond – regular.

i have succed to find the css style which hides the calendar part and show only the month and year :

<style type="text/css">
      .ui-datepicker-calendar {    display: none;    }​
</style>

but i cant find away telling : this datepicker instance SHOULD self-apply this css ,and the other should NOT.

how can fix my code to apply the css only to 1 control ?

enter image description here

  • 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-06T11:09:20+00:00Added an answer on June 6, 2026 at 11:09 am

    Either add a second class explicitly to the date picker that has display: none as its only attribute, or explicitly set the style of the restricted date picker, e.g.:

    $('.ui-datepicker-calendar').first().css('display', 'none');
    

    EDIT 1 that doesn’t work – the two date pickers share the same elements so you can’t tell them apart like that.

    EDIT 2 The best I’ve been able to do so far is to add this:

    $('#datepicker').click(function() {
        $('.ui-datepicker-calendar').hide();
    });
    

    Which does hide the calendar, but does unfortunately make it appear very briefly before it disappears.

    EDIT 3 Solved! 🙂

    The trick is to apply your global CSS to every date picker so that they’re hidden by default, but then explicitly show the calendar fields for the other one whenever it’s triggered:

    $('#datepicker2').click(function() {
        $('.ui-datepicker-calendar').show();
    });
    

    This is much more visually appealing than having the calendar appear for a fraction of a second and then disappear again.

    NB: you may have to register this handler for any other UI events that will cause the date picker to appear – .click() on its own may be insufficient.

    Working demo at http://jsbin.com/oredoy/

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

Sidebar

Related Questions

I have a very simple task but got confused. I need my action to
I have a fairly simple task: I need to read a PDF file and
I have a simple task I need to perform in Python, which is to
I need a simple application, preferably a cross-platform one, that enables sending of files
I need something simple; I have page where a user clicks an author to
That's a simple task in ASP.NET WebForms:If you want to show/hide a control all
I have a simple task list which contains amongst others a title field and
This is a simple question, and a seemingly simple task but I can't find
I'm having trouble coding a simple task for loop. What I need for the
Pretty simple task: using jquery I need to calculate the width of an input

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.