Reputation: 11448
I am trying to send an ajax request immediately after a date is chosen with the jquery datepicker.
I have:
<script>
$(function() {
$( "#datepicker" ).datepicker({dateFormat: "dd-mm-yy" });
});
var sentdate=("#datepicker").val();
$.ajax({
url: "callthephp.php?d="+sentdate,
success: function(data) {
$("#output").html(data);
}
});
</script>
<div class="demo">
<p>Date: <input id="datepicker" type="text"></p>
</div>
<div class="output">
</div>
Any ideas how I get this working?
Upvotes: 2
Views: 1053