events not working on datepicker input
mahdisoftdev opened this issue · comments
hellow,i want to run some event on datepicker field with addEventListener in js but it dosent work,how can I run some event after the date changing?
Add your event listeners to the input which you assign the datepicker to. There should not be any problem, if you still had issues send me your snippet so I can investigate it further.
here is my code
`
<script src="assets/libs/persian-datepicker/kamadatepicker.min.css"></script>input type text with jobReserveDate id
<script src="assets/libs/persian-datepicker/jquery.min.js"></script> <script src="assets/libs/persian-datepicker/kamadatepicker.min.js"></script> <script src="assets/js/app.js"></script>`
and in app.js file i have:
`
const jobReserveDate = document.getElementById('jobReserveDate');
if(jobReserveDate !== null){
jobReserveDate.addEventListener('change' , function(){
alert("change");
}, false);
}
kamaDatepicker('jobReserveDate',
{ buttonsColor: "red",
markToday: true,
markHolidays: true,
twodigit:true,
forceFarsiDigits: true,
});
`
and some other thing,if it work sometime i change the input value with js thate is reason for triggring change event and i whould not like this,are you able to create some property in config that take js function and function has been runned after date picked?