"Form + Filter + jQuery"
Bootstrap 3.3.0 Snippet by spacemunkey77

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/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 id="container"> <div id="searchbar"> <form method="post" role="search"> <div class="row"> <div class="col-xs-8 col-xs-offset-2"> <div class="input-group"> <div class="input-group-btn search-panel"> <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span id="search_concept">Filter by</span> <span class="caret"></span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#Title">Title</a></li> <li><a href="#Author">Author</a></li> <li><a href="#SubjectAreas">Subject Areas</a></li> <li><a href="#Publisher">Publisher</a></li> <li class="divider"></li> <li><a href="#all">All Areas</a></li> </ul> </div> <input type="hidden" name="search_filter" value="all" id="search_filter"> <input type="text" class="form-control" id="searchbox" name="search_text" placeholder="Search term..."> <span class="input-group-btn"> <button class="btn btn-default" type="submit"><span class="glyphicon glyphicon-search"></span></button> </span> </div> </div> </div> </form> </div> </div>
body{ margin-top:20px; } #container { margin: 30px auto; max-width: 1024px; background-color: whitesmoke; line-height: 1.5em; padding: .5em; border-radius: 20px; text-align: center; background-position: left top; background-repeat: no-repeat; padding-top: 332px; } body { background-color:silver; background-image: radial-gradient(circle at 100% 150%, silver 24%, white 25%, white 28%, silver 29%, silver 36%, white 36%, white 40%, transparent 40%, transparent), radial-gradient(circle at 0 150%, silver 24%, white 25%, white 28%, silver 29%, silver 36%, white 36%, white 40%, transparent 40%, transparent), radial-gradient(circle at 50% 100%, white 10%, silver 11%, silver 23%, white 24%, white 30%, silver 31%, silver 43%, white 44%, white 50%, silver 51%, silver 63%, white 64%, white 71%, transparent 71%, transparent), radial-gradient(circle at 100% 50%, white 5%, silver 6%, silver 15%, white 16%, white 20%, silver 21%, silver 30%, white 31%, white 35%, silver 36%, silver 45%, white 46%, white 49%, transparent 50%, transparent), radial-gradient(circle at 0 50%, white 5%, silver 6%, silver 15%, white 16%, white 20%, silver 21%, silver 30%, white 31%, white 35%, silver 36%, silver 45%, white 46%, white 49%, transparent 50%, transparent); background-size:100px 50px; } #searchbar { position: absolute; top: 300px; left: 500px; padding-right: 20px; }
$(document).ready(function(e){ $('.search-panel .dropdown-menu').find('a').click(function(e) { e.preventDefault(); var param = $(this).attr("href").replace("#",""); var concept = $(this).text(); $('.search-panel span#search_concept').text(concept); $('.input-group #search_param').val(param); }); });

Related: See More


Questions / Comments: