jquery - Bootstrap-confirmation not binding to dynamic elements? -
i have form uses ajax load dynamic content on page. using bootstrap-confirmation
use confirm function cancels request. confirmation works when page loaded.
here example code:
$(function() { $('[data-toggle=confirmation]').confirmation({ rootselector: '[data-toggle=confirmation]', popout: true }); $(document).on('submit', '#some-form', function(e) { e.preventdefault(); submitform(); }); $('.static-element').on('click', '.cancel-request', function() { cancelrequest(); }); }
the click event .cancel-request
works on dynamic content, confirmation not. i've tried changing selector on click handler document
makes no difference. can't find way bind confirmation dynamic element.
i've tried creating callback on cancelrequest()
, reinitializing bootstrap-confirmation
inside made no difference. tried reinializing inside complete:
option didn't work either.
i tried twitter bootstrap confirmation not working dynamically generated elements among few other answers, doesn't work in situation.
Comments
Post a Comment