Click here to Skip to main content
12,077,911 members (47,697 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: Javascript PHP
Hi all,

I want to put a javascript datepicker in a while loop... but it didnt work for me...

Here is my code..
window.onload = function(){
		new JsDatePick({
			useMode:2,
			target:"dateFrom",
			dateFormat:"%Y-%m-%d"
			
		});
 
<input type="text" name="dateFrom" id="dateFrom?>" value="<?php  echo $dateFrom ??>" style="width:70px;"  />
Posted 7-Dec-12 19:54pm
Edited 7-Dec-12 19:57pm
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

use jquery date picker that wil display date to text box

u just post to php file u get the date and time

<!doctype html>
 
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Datepicker - Default functionality</title>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <script>
    $(function() {
        $( "#datepicker" ).datepicker();
    });
    </script>
</head>
<body>
 
<p>Date: <input type="text" id="datepicker" /></p>
 

</body>
</html>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web04 | 2.8.160212.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100