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?

Recommended Answers

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

Jump to Post

There must be some issue elsewhere outside of this. I am able to make it work fine here http://jsfiddle.net/pixelsoul/asyRD/

Jump to Post

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/

Jump to Post

All 10 Replies

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.