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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:15:12+00:00 2026-06-04T23:15:12+00:00

I am working on a jquery date picker. I need to select a date

  • 0

I am working on a jquery date picker. I need to select a date but after date selection from the calendar I need the date to divide into three separate drop downs. One for day one for month and one for year. Here is my jquery script.

  <script type="text/javascript">
    $(document).ready(function() {

   $(function() {
    $( "#fullDate" ).datepicker({
    onClose: function(dateText, inst) {
       $('#day').val( dateText.split('/')[2] );
       $('#month').val( dateText.split('/')[1] );
   $('#year').val( dateText.split('/')[0] );
    }
 });
});
}); 
</script> 

HTML

<div class="demo">

<p>Date: <input id="fullDate" type="text" style="display:block"></p>
day:<select name="day" id="day" style="width:100px">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>

 month:<select name="month" id="month" style="width:100px">
 <option>1</option>
 <option>2</option>
  <option>3</option>
 <option>4</option>
 <option>5</option>
 </select>

year:<select name="year" id="year" style="width:100px">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div><!-- End demo -->
  • 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-04T23:15:14+00:00Added an answer on June 4, 2026 at 11:15 pm

    Working demo please click here : ] http://jsfiddle.net/gvAbv/13/ or http://jsfiddle.net/gvAbv/8/

    In demo click on the text box and select dates and bingo you will get the drop downs auto populated.

    Point to note dateText.split('/')[2] is year not day 🙂 if you will switch over the place your code will work.

    i.e. dateText.split('/')[2] : year ; dateText.split('/')[0] : month ; dateText.split('/')[0] : day rest demo will help you to make it clear.

    The demo has extra bits but it will help you!

    code

    $(function() {
        $("#fullDate").datepicker({
            onClose: function(dateText, inst) {
                $('#year').val(dateText.split('/')[2]);
                $('#month').val(dateText.split('/')[0]);
                $('#day').val(dateText.split('/')[1]);
            }
        });
    });
    

    ANother Demo for image click: http://jsfiddle.net/zwwY7/

    code

    $(function() {
        $("#fullDate").datepicker({
             buttonImage: 'icon_star.jpg',
            buttonImageOnly: true,
            onClose: function(dateText, inst) {
                $('#year').val(dateText.split('/')[2]);
                $('#month').val(dateText.split('/')[0]);
                $('#day').val(dateText.split('/')[1]);
            }
        });
    });
    
    ​
    

    Images
    enter image description here

    enter image description here

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

Sidebar

Related Questions

I have the jQuery datepicker working, but I need to be able to select
can i use jquery date picker with usercontrol of ASP.Net..?/ i tried but its
I've implemented the jQuery datepicker. It seems to be working fine but the calendar
i am working on jquery calender but i need to call a function both
I have a jquery autocomplete field working fine followed by a date input field.
I'm working with jquery mobile library... Couple of days a go...I ran into a
I've got this answer working but I'd like to extend it: jQuery UI Datepicker
I am trying to get a date picker working and I am really struggling
I'm using the jQuery UI Date Picker on mobile web and testing in Android
My Datetime picker is working fine for Html.TextBoxFor but when i have Html.EditorFor it

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.