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

  • Home
  • SEARCH
  • 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 7856233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:38:26+00:00 2026-06-02T20:38:26+00:00

How can I change the css display attribute of the ui-datepicker-calendar class after the

  • 0

How can I change the css display attribute of the ui-datepicker-calendar class after the datepicker has already been initialized? I have a html form with a selectable checkbox from which I want to toggle the display of this table. I’ve tried the following:

HTML sample:

 <div class="row">
  <div class="adddescr"><label for="date">Zeitraum:</label></div>
  <div class="addinput" id="date"><input type="text" id="datefrom" name="datefrom" class="date" /> - <input type="text" id="dateto" name="dateto" class="date" /></div>
 </div>
 <div class="row">
  <div class="addinput"><label><input type="checkbox" id="dateplanedcheck" /> grobe Planung</label></div>
 </div>

JS first approach:

 <script>
  $(document).ready(function() {
   $("#datefrom, #dateto").datepicker({ dateFormat: "dd.mm.yy",

   [...]

    beforeShow: function(input, inst) {
     if ($("#dateplanedcheck").is(':checked')) {
      $(".ui-datepicker-calendar").css("display", "none");
    }}
   });

   [...]

  });
 <script>

The beforeShow is called, but the calender is still displayed.

JS second approach:

 <script>
  $(document).ready(function() {

  [....]

   $("#dateplanedcheck").change(function() {
    if ($(this).is(':checked')) {
      $(".ui-datepicker-calendar").css("display", "none");
    }
   });
  });
 </script>

What am I missing? Does this even work with jQuery?
Thanks in advance!

  • 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-02T20:38:27+00:00Added an answer on June 2, 2026 at 8:38 pm

    So you want to NOT show the calendar if the checkbox is checked?

    Just return false; in the beforeShow.

    $("#datefrom, #dateto").datepicker({
        dateFormat: "dd.mm.yy",
        beforeShow: function(input, inst) {
            if ($("#dateplanedcheck").prop('checked')) {
                return false;
               }
    
        }
    });
    

    http://jsfiddle.net/JzbPD/

    Answer:

    Still displaying the calendar but making it invisible:

    BeforeShow can’t access the ui-datepicker-calendar on the table because it hasn’t been rendered yet. Apply a class like$(inst.dpDiv).addClass('calendar-off') and then have the style .calendar-off table.ui-datepicker-calendar { display none; } like this: http://jsfiddle.net/JzbPD/4

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

Sidebar

Related Questions

How can I change CSS display none or block property using jQuery?
I have several large CSS files and making a change can sometimes take a
Is there a way to change an attribute of a CSS class using javascript?
here is the sample: http://jsfiddle.net/Zg55k/ How can I change css background image and color
Can't seem to get jQuery to change my css. In my css file this
How i can change the color with gradient??? I have this now,but is different
My javascript runs like this on firebug: tr=$(this).parent('tr'); tr.find('.img-delete').css('display','block'); but I can't see the
I have the following HTML: <ul> <li id=about><a href=#about class=goto_about>About us<span>who we are</span></a></li> <li
I have a series of divs that I've hidden with css display:none;. <div id=
I'm trying to change the display CSS property of a <div> tag when the

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.