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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:31:40+00:00 2026-05-24T10:31:40+00:00

I have experimented with the datepicker in the jQuery UI and can get it

  • 0

I have experimented with the datepicker in the jQuery UI and can get it working with select boxes but only when there is a day, month and year select box (http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerIntoSelects.html).

What I need is to have a day and a month-year box like the one that can be seen here…(http://www.bookassist.com/hotels/index.jsp?source=org)

Anyone out there know if this can be done? Totally hit a brick wall.

  • 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-05-24T10:31:41+00:00Added an answer on May 24, 2026 at 10:31 am

    Basically, you need to modify this part from http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerIntoSelects.html

    Change this part, the initialization of the datePicker,

    $(function()
    {
    
        // initialise the "Select date" link
        $('#date-pick')
            .datePicker(
                // associate the link with a date picker
                {
                    createButton:false,
                    startDate:'01/01/2005',
                    endDate:'31/12/2010'
                }
    

    to this, by adding the months array and updating the endDate.

    $(function()
    {
        var months = ["January","February","March","April","May","June","July","August","September","October","November","December"];
    
        // initialise the "Select date" link
        $('#date-pick')
            .datePicker(
                // associate the link with a date picker
                {
                    createButton:false,
                    startDate:'01/01/2005',
                    endDate:'31/12/2015'
                }
    

    Then, change the function that updates the 3 selects (d,m,y)

    var updateSelects = function (selectedDate)
    {
        var selectedDate = new Date(selectedDate);
        $('#d option[value=' + selectedDate.getDate() + ']').attr('selected', 'selected');
        $('#m option[value=' + (selectedDate.getMonth()+1) + ']').attr('selected', 'selected');
        $('#y option[value=' + (selectedDate.getFullYear()) + ']').attr('selected', 'selected');
    }
    

    to just (d,m) with the month specified in this format “August 2011”.

    var updateSelects = function (selectedDate)
    {
        var selectedDate = new Date(selectedDate);
        $('#d option[value=' + selectedDate.getDate() + ']').attr('selected', 'selected');
        $('#m option[value=' + (months[selectedDate.getMonth()]) + ' ' +  (selectedDate.getFullYear()) + ']').attr('selected', 'selected');
    }
    

    Then change the function that updates the picker when changing the selects from this

    // listen for when the selects are changed and update the picker
    $('#d, #m, #y')
        .bind(
            'change',
            function()
            {
                var d = new Date(
                            $('#y').val(),
                            $('#m').val()-1,
                            $('#d').val()
                        );
                $('#date-pick').dpSetSelected(d.asString());
            }
        );
    

    Into this, (EDIT: I mistakenly swapped the year value and day value in my previous answer.)

    // listen for when the selects are changed and update the picker
    $('#d, #m')
        .bind(
            'change',
            function()
            {
                var d = new Date(
                            $('#m').val().split(" ")[1],
                            months.indexOf($('#m').val().split(" ")[0]),
                            $('#d').val()
                        );
                $('#date-pick').dpSetSelected(d.asString());
            }
        );
    

    This is the http://jsfiddle.net/2Nedr/1/ that does just that.
    Hope that solves your problem.

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

Sidebar

Related Questions

I am using jQuery Mobile in my web application. There is a datepicker which
I have experimented the inconsistency when multiple threads access/modify context variables but could not
I have experimented with a sigmoid and logarithmic fade out for volume over a
I know this isn't strictly a programming question but y'all must have experienced this.
I am working on a simulation system. I will soon have experimental data (histograms)
I have experimented with several different static analyzers for Java, notably Findbugs and PMD.
I'm new to SVN and have experimented with it locally on my Dreamhost test
I have experimented with this: >> code-block: copy [] == [] >> append code-block
I have experimented with a technique that involves a web page request which you
I would like app to add several (2k) words to UserDictionary. I have experimented

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.