"Nav Bar - Search Bar - Split Button - Update Select"
Bootstrap 3.0.3 Snippet by xrozix

<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <div class="col-md-12"> <BR></BR> <nav class="navbar navbar-default"> <div class="nav nav-justified navbar-nav"> <form class="navbar-form navbar-search" role="search"> <div class="input-group"> <input type="text" class="form-control"> <div class="input-group-btn"> <button type="button" class="btn btn-search btn-danger"> <span class="glyphicon glyphicon-search"></span> <span class="label-icon">Search</span> </button> <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li> <a href="#"> <span class="glyphicon glyphicon-user"></span> <span class="label-icon">Search By User</span> </a> </li> <li> <a href="#"> <span class="glyphicon glyphicon-book"></span> <span class="label-icon">Search By Organization</span> </a> </li> </ul> </div> </div> </form> </div> </nav> <BR></BR> <nav class="navbar navbar-default"> <div class="nav nav-justified navbar-nav"> <form class="navbar-form navbar-search" role="search"> <div class="input-group"> <input type="text" class="form-control"> <div class="input-group-btn"> <button type="button" class="btn btn-search btn-success"> <span class="glyphicon glyphicon-search"></span> <span class="label-icon">Search</span> </button> <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu pull-right" role="menu"> <li> <a href="#"> <span class="glyphicon glyphicon-user"></span> <span class="label-icon">Search By User</span> </a> </li> <li> <a href="#"> <span class="glyphicon glyphicon-book"></span> <span class="label-icon">Search By Organization</span> </a> </li> </ul> </div> </div> </form> </div> </nav> <BR><BR> <nav class="navbar navbar-default"> <div class="nav nav-justified navbar-nav"> <form class="navbar-form navbar-search" role="search"> <div class="input-group"> <div class="input-group-btn"> <button type="button" class="btn btn-search btn-default dropdown-toggle" data-toggle="dropdown"> <span class="glyphicon glyphicon-search"></span> <span class="label-icon">Search</span> <span class="caret"></span> </button> <ul class="dropdown-menu pull-left" role="menu"> <li> <a href="#"> <span class="glyphicon glyphicon-user"></span> <span class="label-icon">Search By User</span> </a> </li> <li> <a href="#"> <span class="glyphicon glyphicon-book"></span> <span class="label-icon">Search By Organization</span> </a> </li> </ul> </div> <input type="text" class="form-control"> <div class="input-group-btn"> <button type="button" class="btn btn-search btn-default"> GO </button> </div> </div> </form> </div> </nav> <BR></BR> <nav class="navbar navbar-default"> <div class="nav nav-justified navbar-nav"> <form class="navbar-form navbar-search" role="search"> <div class="input-group"> <input type="text" class="form-control"> <div class="input-group-btn"> <button type="button" class="btn btn-search btn-info"> <span class="glyphicon glyphicon-search"></span> <span class="label-icon">Search</span> </button> </div> </div> </form> </div> </nav> </div> </div> </div>
/* nav bar search box - drop down menu button */ .navbar .navbar-search .dropdown-menu { min-width: 25px; } .dropdown-menu .label-icon { margin-left: 5px; } .btn-outline { background-color: transparent; color: inherit; transition: all .5s; }
$(function(){ $(".input-group-btn .dropdown-menu li a").click(function(){ var selText = $(this).html(); //working version - for single button // //$('.btn:first-child').html(selText+'<span class="caret"></span>'); //working version - for multiple buttons // $(this).parents('.input-group-btn').find('.btn-search').html(selText); }); });

Related: See More


Questions / Comments: