We help IT Professionals succeed at work.
Get Started

Doubt regarding jQuery time picker

Last Modified: 2012-06-21
Hi Experts...
I have a jQuery datetime picker which works fine but i want to retain the plugin format and distribute the plugin's output in two separate text boxes instead of a single one.

Now in a single text box itself the output got is for example:11/05/2011 16:52:43 which i want to put in two text boxes with the name date and time.

And how to i initiate the plugin using an onclik event of a button instead of onselect of the text box which is the default behaviour.

The code and reqired files are attached below.

Please help...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <link rel="stylesheet" media="all" type="text/css" href="jquery-ui-1.8.16.custom.css" />
   <style type="text/css">
   #ui-datepicker-div{ font-size: 80%; }
   /* css for timepicker */
   .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
   .ui-timepicker-div dl { text-align: left; }
   .ui-timepicker-div dl dt { height: 25px; }
   .ui-timepicker-div dl dd { margin: -25px 10px 10px 65px; }
   .ui-timepicker-div td { font-size: 90%; }
   .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
<script type="text/javascript" src="jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="jquery-ui-timepicker-addon.js"></script>
<script type="text/javascript"> 
 showSecond: true,
 timeFormat: 'hh:mm:ss'
 <input type="text" name="example6" id="example6" value="" />

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE