0

I have the following boostrap popover, it works in firefox and chrome but doesnt seem to display in IE10?

<div class="form-group">
    <label for="car">Car</label>
    <select class="form-control js-popover-trigger" data-trigger="focus" id="car" name="car">
       <option value="">Please Select</option>
       <option value="BMW">BMW</option>
       <option value="Audi">Audi</option>
       <option value="VW">VW</option>
    </select>
</div>

<div id="popup-content" style="display: none;">
    <div>Some content...</div>
</div>

My jquery call:

$(function () {
    $('.js-popover-trigger').popover({
        html: true,
        content: function () {
            return $('#popup-content').html();
        }
    });
});
RevanthKrishnaKumar V.
  • 1,855
  • 1
  • 21
  • 34
adam78
  • 9,668
  • 24
  • 96
  • 207
  • any JS errors in dev tools console? I have a suspicion (for no good reason) that it's from using the function () in content. you don't need it there really, you can just use content: $('#popup-content').html(); – jdu Jul 27 '15 at 14:41
  • I get jquery.validate.min.js, line 50 character 199 error when I select an option in IE10 console. No errors in firefox or chrome? highlighted line is return c.event.handle.call(this,e) – adam78 Jul 27 '15 at 14:59

2 Answers2

0

Fixed by upgrading to jQuery Validation 1.14.0 from jQuery Validation 1.8.1

adam78
  • 9,668
  • 24
  • 96
  • 207
0

We can use bootstrap popover events and toggle popovers when clicked.

var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");

if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./))  
{
    $('html').click(function (e) {

        var attr = $(e.target).attr('data-toggle');
        if (typeof attr === typeof undefined || attr === false) {
            $('a[data-toggle=popover]').popover('destroy');
        }                            
    });

    $('a[data-toggle=popover]').click(function () {
        $('a[data-toggle=popover]').popover('destroy');
        $(this).popover('show');
    });
}
Tunaki
  • 132,869
  • 46
  • 340
  • 423
Ram Kumar
  • 51
  • 1
  • 6