lewis4u
lewis4u

Reputation: 15067

jQuery bootstrap datetimepicker field event

I'm using this Datetimepicker and i want to assign an event trigger when date has been chosen so that i can calculate the difference in another field

the problem is that if i use click like this

$(document).on('click', '.item',function(){
    ...

The user is not actually clicking the field but the datetimepicker windows that is actually out of the focus from this field...and i have also tried with

select focus change

they all kind a work but the user needs to click again or go over that field...in short additional actions are needed...

So the question is:

Is there some event trigger that can recognize the input field change?

Upvotes: 0

Views: 240

Answers (1)

lewis4u
lewis4u

Reputation: 15067

In order to catch the change of the field of datetimepicker you need to use this command

$(document).on('dp.change', '.item',function(){ 
      . . .// your code

there is one more datitimepicker version and on that other one it's change.dp

Upvotes: 0

Related Questions