I have a textbox with datepicker jquery plugin. When i select a date ,post ajax call is made and i want to return some data from database and textbox should remain on top of the page so that furthur requests can also be made.
<script>
$(document).ready(function(){
//create date pickers
$("#datepicker").datepicker(
{
changeMonth: true,
changeYear: true,
dateFormat: 'yy-mm-dd',
onSelect: function(date)
{
$.ajax({
type:"POST",
url:"seestuffs.php",
data:date,
success: function(result)
{
document.write(result);
}
});
}
});
});
</script>
<body>
<p>Date: <input type="text" id="datepicker" name="date" /></p><br/>
</body>
And here is my seestuffs.php
<?php
if(isset($_POST['date']))
{
$date = $_POST['date'];
echo 'hello';
}
?>
But hello is not displayed on the page.Where am I going wrong!!Thanx in advance..