View Single Post
  #3 (permalink)  
Old 28-Jun-2009, 11:47
maill maill is offline
Student Penguin
 
Join Date: May 2009
Location: Jakarta, Beijing
Posts: 77
maill hasn't been rated much yet
Default Re: JQuery DatePicker & PHP

Hi kev,
here's an example to assign the output to a field, as mentioned in the previous post,
Code:
<!DOCTYPE html>
<html>
<head>
  <link type="text/css" href="http://jqueryui.com/latest/themes/base/ui.all.css" rel="stylesheet" />
  <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.3.2.js"></script>
  <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.core.js"></script>
  <script type="text/javascript" src="http://jqueryui.com/latest/ui/ui.datepicker.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
    $("#datepicker").datepicker({
 onSelect: function(dateText, inst) { alert(dateText);document.getElementById('thedate').value=dateText; }
}
);
  });
  </script>
</head>
<body style="font-size:62.5%;">
  
<div type="text" id="datepicker"></div>
<form method=post>
<input type='text' id='thedate' name='thedate' />
</form>
</body>
</html>
the date chosen is in $_POST['thedate']

HTH
__________________
"And just as you want men to do to you, you also do to them likewise."
Luke 6:31 NKJV
Reply With Quote