I'm having problems binding Bootstrap Tags to an input field an I think its because input field is dynamically created with ajax. Simply nothing is firing.
echo " <div class='tags-cont'>
<input value='".$tags."' class='tags' type='text' name='tags' data-role='tagsinput' placeholder='Add tags' />
</div>";
Scrtipts are embeded before body closing tag:
<script src='scripts/plugins/bootstrap_tags/bootstrap-tagsinput.js' type='text/javascript'></script>
<link href='scripts/plugins/bootstrap_tags/bootstrap-tagsinput.css' rel='stylesheet' type='text/css' />
I got it. For anyone who will stumble on this in the future:
Remove:
data-role="tagsinput"
And instantiate tagsinput on ajaxComplete:
$(document).ajaxComplete(function(){
$('.tags').tagsinput({
maxTags: 3
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With