Good afternoon.
Value in input change using datepicker ui.
I want to use ajax post when input value is changed.
For this, I use a script:
<input type="text" name="date" class="datepicker" id="datepicker">
$(".datepicker").datepicker({changeYear: true});
$(".datepicker").on("change",function(){
var date=$(this).val();
$.post("test.php", {
date:date
},
function(data){$('#testdiv').html('');$('#testdiv').html(data);
});
});
But the post ajax post request is executed with the old date.
Datepicker doesn't matter the change in input time.
Tell me how to execute the request after datepicker change the date in the field?
I need:
1) datepicker will change the date;
2) The request must be sent with a new date.
source
share