yuvi
yuvi

Reputation: 18427

bootstraps modal event 'shown' not firing on IE 8

In my django site I am using bootstrap's modal to show a form. However, part of that form is a date-field and I want to use jQuery UI datepicker. Since the form is fetched dynamically, I looked into using bootstrap's modal events to apply the functionality after the modal is being displayed. I did this:

$('#myModal').modal().on('shown', function() { 
    $('.datepicker').datepicker();
});

This is working on chrome, but not on IE 8. I need to support it, and having the datepicker is critical. I don't see any error messages, so I think my code is ok, and adding a few alert messages told me that in IE the event isn't even firing. What should I do?

I am using bootstrap 2.2

p.s. I already tried switching places and doing .modal() after .on('shown' but to no avail. The page is rendered in standarts mode and with IE8 compatibility, I made sure of that. I'm guessing this is a problem with IE I am not familiar with.

Upvotes: 0

Views: 1104

Answers (1)

earnaz
earnaz

Reputation: 435

Try with:

$('#myModal').on('shown', function() { 
    $('.datepicker').datepicker();
}).modal();

I solved the same problem with this solution. Show this link.

Upvotes: 1

Related Questions