How to generate a modalpopup in bootstrap when a value in a dropdown is changed?
I have my javascript like this ..I am raising an event to show the modalPopup
$("#City").change(function () {
if ( $("option:selected", $("#City")).text() == "Others") {
alert("hi");
showModalPopup();
}
});
function showModalPopup() {
$("#myModal").modal("show");
}
I am getting the alert but I am unable to see the modal popup.
And this is the html code for that popup from bootstrap example
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div class="modal-body">
<p>One fine body…</p>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="btn btn-primary">Save changes</button>
</div>
I am new to bootstrap .Please help me out.