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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:41:29+00:00 2026-06-03T08:41:29+00:00

I am using the jquery Trent Richardson datetimepicker addon which is working fine when

  • 0

I am using the jquery Trent Richardson datetimepicker addon which is working fine when linked to a text input (see link below).

http://jsfiddle.net/many_tentacles/xnn3M/1/

However, when I attach it to a div so that the picker shows all the time, and an altField option, the date and time do not display correctly in the altfield (see link below). I can create a similar problem if I add an altField to the version that works so I think it might have something to do with this.

http://jsfiddle.net/many_tentacles/EyPm5/

  • 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-03T08:41:31+00:00Added an answer on June 3, 2026 at 8:41 am

    Hiya please see working demo here: http://jsfiddle.net/Dgnjn/

    D’uh don’t forget to upvote and accept :))

    You can use the onSelect event:

    $('#datetimepicker').datetimepicker({
        //altField: '#alternate',
        dateFormat: 'yy-mm-dd',
        timeFormat: 'hh:mm:ss',
        stepHour: 2,
        stepMinute: 10,
        onSelect: function(dateText, inst) { 
          var dateAsString = dateText; //the first parameter of this function
          var dateAsObject = $(this).datepicker( 'getDate' ); //the getDate method
    
            $('#alternate').val(dateAsObject);
           // alert(dateAsObject + '==> ' + $('#alternate').val());
       }
    
    });
    

    The first parameter is in this case the selected Date as String. Use parseDate to convert it to a JS Date Object.

    See http://docs.jquery.com/UI/Datepicker for the full jQuery UI DatePicker reference.

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

Sidebar

Related Questions

Using jquery how do I find out the target value of a href link.
I am making an ajax request using Jquery and everything works fine except the
Using jQuery what is the best way of editing option text for a given
I'm using jquery 1.5 and html4 standard. I'm trying to set custom attribute which
I'm working on a jQuery Mobile site but we're not using the AJAX transitions
Using jQuery's dialog I came across the following quirk (tested in FF3): User selects
Using jQuery I want to bind an existing function to a button. I've been
Using jQuery I'm creating a basic 'tooltip' animation so that the tooltip will appear
Using JQuery it possible to clone a Div like this and change add a
Using jQuery, can you show me the syntax for playing a sound? I would

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.