0

I want to call a function whenever user changes date in a datepicker but it is not working. I have already checked link for Question JQuery Datepicker onchange event help! but it didnt help.

Below is my code and what i have tried:

<h:inputText id="animalBornDateId"
value="#{myController.animalBornDate}"
styleClass="dtp dateClass" style="width: 80px !important;" >
</h:inputText>

What i tried:

$("#animalBornDateId").datepicker({
    onSelect: function(dateText, inst) {
        var date = $(this).val();
        var time = $('#time').val();
        alert('on select triggered');

    }
});

Another:

$('#animalBornDateId').on('input',function(e){
                 alert('Changed!')
                });

The below works when i manually enter date inside textbox and click tab which i dont want.

 $('#animalBornDateId').change(function() { 
                alert("test");
            });

I want to call alert function when i select date from the calendar

sTg
  • 4,313
  • 16
  • 68
  • 115

0 Answers0