0
$(".setDate").on('change', 'input', function() {
      alert("s"); //Not working at all

});

$(".setFeastDate").click(function(){
      alert("s"); //Working but on click button
});


<input class="ft-date-picker-sm setDate" value="{{Carbon\Carbon::parse($some_date)->format('l, M j')}}" id="{{$some['id']}}" readonly="true"/>
  • I expect it Should alert on selecting date not input field how could it possible pls suggest
Manish Jakhmola
  • 197
  • 1
  • 3
  • 12

2 Answers2

1

Try:

$(".setDate").bind('change keyup', function() {
    alert("s");
});
Morgs
  • 1,558
  • 3
  • 19
  • 34
0

Simply if you use JQuery you can use 'onSelect' event like

 $("#datepicker").datepicker({
    dateFormat: 'dd M yyyy',
    onSelect: function(dateText){
         // write your logic here 
        }
});

Ref: https://jqueryui.com/datepicker/

Try this:https://jsfiddle.net/1yugqnob/

Mohamed Zaytoun
  • 293
  • 1
  • 11