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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:21:37+00:00 2026-06-16T20:21:37+00:00

Using the latest version of jquery ui’s datepicker, I want to show one hidden

  • 0

Using the latest version of jquery ui’s datepicker, I want to show one hidden div depending on the date selected.

The idea is to have datepicker displayed inline, and when the user selects a date, a hidden div corresponding with that date will show.

Here’s what I’ve got so far… I think I need to use onSelect but I’m having trouble putting it together based on other stackoverflow questions.

    $("#inlinedatepicker").datepicker({
    onSelect: function(date) {
        $('.tohide').hide();
        $('#date' + date).show();
    },
    inline: true,
    minDate: new Date(currentYear),
    beforeShowDay: function(date) {
        if (date.getDay() == 0 || date.getDay() == 1 || date.getDay() == 2 || date.getDay() == 3) {
            return [false, ''];
        } else {
            return [true, ''];
        }
    }
});

So if you selected January 1, 2013, the div with ID= date01/01/2013 would display. I assume the slashes aren’t accepted, so is there a way to work around this?

The HTML for the Jan 1 2013 div would look like this…

<div id="date01/01/2013">...</div>
  • 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-16T20:21:38+00:00Added an answer on June 16, 2026 at 8:21 pm

    One of the issues could be that the “date” that is passed into the onSelect eventhandler is a string in the format “01/18/2013” (depending on the Culture setting of the browser). And it looks like you are using this string (appended with date) to select the div. But the jQuery selectors will throw an exception when it encounters special characters like “/”. One work around is to use

    document.getElementById('date' + date).style.display = "block"; // this works  
                                                                    // with "date01/18/2013"
    

    You could also set the selector id without the slashes, and then in the onSelect event handler remove the slashes from the string, and use that in the jquery selector.

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

Sidebar

Related Questions

I'm using the latest version of JQuery and trying to animate a div to
I'm using the latest version of the jquery plugin DataTables and I tried to
I'm using the latest version (v1.6.2) of nyromodal lightbox : jQuery.nyroModalSettings({title:'Manual Title'}); It won't
I'm using: jQuery validation plug-in 1.6 * http://bassistance.de/jquery-plugins/jquery-plugin-validation/ with the latest version of jQuery.
I'm using the latest version of jquery.jcrop. When invoking jcrop() on an image, the
I am using jquery 1.3.2 but I have updated to the latest version: The
I am using latest version of jQuery Autocompletion plugin and have populated an array
I am using the latest version of jQuery and ASP.NET MVC 3 with the
Why is this selector not working? I'm using the latest version of JQuery Mobile
I'm using the latest version of the jQuery Validator plugin along with jQuery (1.6.2).

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.