Bootstrap 3 Datetimepicker

Asked

Viewed 139 times

2

Gentlemen.,

I have had difficulties in understanding the documentation regarding Bootstrap 3 Datepicker v4. I couldn’t figure out how to trigger the event dp.show() for a specific element, $("#txtDataHora_01") for example.

I’m in need of some help with that.


From now on, thank you for your attention

  • Can you create a jsFiddle? and/or place the code you are using in the question?

  • Sergio, thanks for your attention! But maybe you understand me this way: I need to fire the event show() of the element $("#txtDataHora_01") via Jquery. Remembering that I am using the Datepicker Bootstrap 3 Plugin.

2 answers

1

The show event is shot as follows:

$("#txtDataHora_01").datepicker('show');
  • Fernando Medeiros, thank you for trying to help! $("#txtDataHora_01").datepicker('show'); does not trigger the event. I remember that I am using the Plugin Bootstrap 3 Datepicker v4. It differs greatly from the previous version.

0

Try to do it this way:

$(function () {
    $("#txtDataHora_01").datetimepicker();

    $("#txtDataHora_01").on("dp.change",function (e) {
        //Seu evento aqui.
    });
});

That way, I believe that every time your field is changed, your event will be triggered.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.