views:

37

answers:

3

hello.i'm newbie at web developing. i have some input form.i'm using jquery 1.4.2 inside that i have one textfield specially for input time. i want every one no need to type manually. and also make easy for every user. can you tell me how do i do that?

A: 

Say in your HTML you have:

<input id='intime' type='text' name='intime'>

Then you can set it with:

$('#intime').val(new Date());
sje397
A: 

Use the Date Object. See "15.9.2 The Date Constructor Called as a Function" in the ECMAScript standard for more info.

Paul Butcher
A: 

It sounds like you're after a better UI way to go about this. There are many more date than time widgets out there, but there are time pickers available, my personal favorite is this here: jQuery.timepicker, give it a look.

It's jquery UI Themeable, and if you need a more specific time you can still type in the box, so it works both ways :)

Nick Craver
someone tell me that jQuery Timepicker doesn't work with jQuery 1.4.x..
klox