Click here to Skip to main content
15,881,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

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

Here is my code..
Java
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
Updated 7-Dec-12 18:57pm
v2
Comments
[no name] 12-Dec-12 14:43pm    
U can use the plugins available in the internet to solve your prob.

1 solution

use jquery date picker that wil display date to text box

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

XML
<!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>
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900