I have this code, but now i am stuck:
<input type="text" id="datepicker" value="/">
<script type="text/javascript">
$('#datepicker').datepicker()
.on('changeDate', function(ev){
// Some code..
});
</script>
I want the value of input field to update every time the new date is selected. I want the value to be the date, that was selected.
$(document).ready(function(){
var dp = $("#datepicker");
dp.datepicker({
format : 'mm-dd-yyyy',
});
dp.on('changeDate', function(ev){
dp.val(ev.target.value);
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With