I am using bootstrap popover on my <button>
with data-trigger="click"
. But when user click on that <button>
, I want it to check something beforehand and prevent the popover from showing. For example, if there is input in the form which still empty, popover won't show, else it will show as the normal.
How to do that? I know about BS popover events like .on('show.bs.popover'
, but I still can't get it accomplished.
I have tried to do this:
btn_register.on('show.bs.popover',function() { //when bs popover about to show
if (...) $(this).popover('hide');
});
But popover appear in few miliseconds before it hide. _(:"3