Created
March 24, 2015 07:57
-
-
Save redlotus/66adcf028bbcc806d185 to your computer and use it in GitHub Desktop.
bootstrap combobox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".dropdown-menu li a").click(function(){ | |
var selText = $(this).text(); | |
$(this).parents('.btn-group').find('.dropdown-toggle').html(selText+' <span class="caret"></span>'); | |
}); | |
$("#btnSearch").click(function(){ | |
alert($('.btn-select').text()+", "+$('.btn-select2').text()); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Search box Start --> | |
<form> | |
<div class="well carousel-search hidden-sm"> | |
<div class="btn-group"> <a class="btn btn-default dropdown-toggle btn-select" data-toggle="dropdown" href="#">Select a Country <span class="caret"></span></a> | |
<ul class="dropdown-menu"> | |
<li><a href="#">United States</a></li> | |
<li><a href="#">Canada</a></li> | |
<li class="divider"></li> | |
<li><a href="#"><span class="glyphicon glyphicon-star"></span> Other</a></li> | |
</ul> | |
</div> | |
<div class="btn-group"> <a class="btn btn-default dropdown-toggle btn-select2" data-toggle="dropdown" href="#">Select a Region <span class="caret"></span></a> | |
<ul class="dropdown-menu"> | |
<li><a href="#">California</a></li> | |
<li><a href="#">New York</a></li> | |
<li><a href="#">Massachusetts</a></li> | |
<li class="divider"></li> | |
<li><a href="#">Quebec</a> | |
</li><li><a href="#">Ontario</a> | |
</li><li><a href="#">British Columbia</a> | |
</li> | |
</ul> | |
</div> | |
<div class="btn-group"> | |
<button type="button" id="btnSearch" class="btn btn-primary">Search</button> | |
</div> | |
</div> | |
</form> | |
<!-- Search box End --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment