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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:04:26+00:00 2026-06-13T04:04:26+00:00

i am using jquery ui date picker for users to pick the date when

  • 0

i am using jquery ui date picker for users to pick the date when they pick the date i have a hidden field which adds the value of the date picker in a alternate date format.

what i need to do is dynamically output the value of the hidden input.

i have tried this but it only seems to work if the user types in the date manually and doesn’t use the date picker image icons and scroll through the calendar.

$('#datepicker').keyup(function () {
$('#date-output').text($(this).val());
});

Any help would be greatly appreciated.

Jquery date picker code

//date pickers
$(function() {
    $( "#datepicker" ).datepicker({
        showOn: "button",
        buttonImage: "images/calendar.gif",
        buttonImageOnly: true,
        dateFormat:"dd/mm/yy",
        minDate: +0,
        altField: "#alternate",
        altFormat: "D MM d",
        onSelect: function(dateText, inst) {
        var suffix = "";
        switch(inst.selectedDay) {
            case '1': case '21': case '31': suffix = 'st'; break;
            case '2': case '22': suffix = 'nd'; break;
            case '3': case '23': suffix = 'rd'; break;
            default: suffix = 'th';
        }

    $("#alternate").val($("#alternate").val() + suffix);
}
        });
    });

HTML

<input name="datepicker" class="calendarInput" type="text" id="datepicker">
<input name="alternate" id="alternate" type="hidden" >
<span id="date-output"></span>
  • 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-13T04:04:27+00:00Added an answer on June 13, 2026 at 4:04 am

    DEMO

     onSelect: function(dateText, inst) {
        var suffix = "";
        switch(inst.selectedDay) {
            case '1': case '21': case '31': suffix = 'st'; break;
            case '2': case '22': suffix = 'nd'; break;
            case '3': case '23': suffix = 'rd'; break;
            default: suffix = 'th';
        }
    
        var val = $("#alternate").val() + suffix;
        $("#alternate").val(val);
        $('#date-output').text(val);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jQuery's Date Picker for one of my form's field - Date of
I have implemented jquery date picker, but I'm struggling with parsing datetime value. Scenario
I am using jquery date picker to pick two dates when searching my database.
I have a Date Input text box generated by jquery Date Picker which is
I have been using the jQuery date picker for a while and its great.
I'm using the JQuery DatePicker to have the user pick a date and have
I am using jquery date picker in textbox and i want the user cannot
I am using the jQuery Date picker, but it is too heavy, the minified
I'm using the jQuery date picker widget and it works nicely but I'm confused
I'm using a ready made jquery date picker with ASP.NET text boxes. I'm also

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.