Jquery date picker dont set value to date selected
0
$("#forecastfrom").datepicker({ dateFormat: "yymmdd", // minDate: 0,//set current date as minDate onSelect: function(date) { var dt2 = $('#forecastto'); var startDate = $(this).datepicker('getDate'); var minDate = $(this).datepicker('getDate'); var $this = $(this) $.ajax({ url: "<?php echo site_url( 'url' ); ?>", type: 'POST', dataType: 'JSON', data: { intDateYYYYMMDD: this.value }, success: function(data) { if (data.error == false) { $this.val(data.message); } }, error: function() { } }).done(function(data) { if (data.error == false) { $this.val(data.message);//set the value