Hi,

I am using timepicker. Onclick of textbox, timepicker open up with time mentioning 12am by default.
but when I click on ok 12.00 am doesn't comes up in the textbox.
The only way it comes up is when I slide it to certain time and back to 12.00 am.
Is there anyway to do this?

We really need to see some code to tell you where the problem is.

here it is

<input class="time_slider" id="starttime" name="starttime" type="text" size="50" />

$('.time_slider').timepicker({
        hourGrid: 4,
        minuteGrid: 10,
        timeFormat: 'hh:mm tt'
  });

The problem is when you click in textbox, timepicker comes up and is displayed as
Time
12:00 am
Hour
<slider>
Minute
<slider>

when I click on done why it doesn't displays 12:00 am in the textbox as hour slider in pointing to 12:00 am

I'm not sure, maybe it was just the way this plugin was designed. You can work around that easily by setting a default value of the input like this http://jsfiddle.net/pixelsoul/asyRD/

Thanks for your help but initially I want the field to be blank :(

But timepicker is not working

I have added this and solved

$('.time_slider').timepicker({
        hourGrid: 4,
        minuteGrid: 10,
        defaultValue: "12:00 am",
        timeFormat: 'hh:mm tt'
});

Interesting, I didn't see an option for that in the plugin. Good to know.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.