I am using codeigniter framework and i am using bootstrap typeahead and all is fine but my problem is when i put it inside the bootstrap modal the bootstrap typeahead will not work. can someone help me? please. this is my code
<a data-target="ajaxify" data-toggle="modal" href="<?php echo base_url()?>task/add_task" class="no-u quick-task">
<h4>Task</h4>
<span>This is a simple description</span>
</a>
and inside my add_task controller i call the view task_view.php and task.js but it seems that the typeahead is not working inside the bootstrap modal.
this is the content of task.js
$(document).ready(function(){
$("#assign_to").typeahead({
source: [{value: 'Charlie'}, {value: 'Gudbergur'}]
});
});
this is the content of task_view.php : just a sample.
<div id="ajaxx" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<!--Your title here -->
<h3>Modal Heading</h3>
</div>
<div class="modal-body">
<form><input type="text" name="assign_to" id="assign_to" /></form>
</div>
<div class="modal-footer">
<!--Your dont change the attributes only the value here -->
<a href="#" id="n0" class="btn n0" data-dismiss="modal">Close</a>
<a href="#" id="y1" class="btn btn-primary y1" data-submit="modal">Save</a>
</div>
I'm using in my custom css following
.modal-body{overflow-y: inherit;}
.modal-open .dropdown-menu {
z-index: 2050;
}
working example of use
make sure to remove typeahead-append-to-body="true"
https://github.com/angular-ui/bootstrap/issues/3262
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