Download
Demo
- Overview
- Documents
User Rating: 4.1/5 ( 7 votes)
Your Rating:
jQuery Typeahead Search is a simple plugin that suggest search results from the character(s) that were typed in the search bar using JavaScript. It is a simple client-side library meaning that no extra processing will be done server-side
BENEFITS
- Open Source project
- The most advanced Typeahead plugin
- "Out of the box" & Cross-browser client-side autocomplete solution
- Quickly display search results to your visitors
- Deep Customization and flexibility
- More, More, More!
Source: runningcoder.org
1. INCLUDE JS FILES
<script src="/vendor/jquery/js/jquery-1.11.0.min.js"></script> <script src="/vendor/runningcoder/jquery-typeahead/jquery.typeahead.js"></script>
2. HTML
<form id="form-country_v1" name="form-country_v1" action="/search/" method="post"> <div class="ui action input"> <input id="country_v1-query" name="country_v1[query]" class="first" type="search" title="search" autocomplete="off" spellcheck="false"> <button id="country_v1-submit" class="ui icon button" type="submit" role="button"> <i class="search icon"></i> </button> </div> </form>
3. JAVASCRIPT
$('#country_v1-query').typeahead({ settings: { order: "desc", jsonList: { data: [ "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo, Democratic Republic", "Congo, Republic of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Greenland", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Mongolia", "Morocco", "Monaco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Samoa", "San Marino", "Sao Tome", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe" ] } }, callback: { onInit: function (node) { console.log('Typeahead Initiated on ' + node.name); } } });
4. OPTIONS
settings: { compression: false, order: null, minCharacter: 2, maxItem: 8, startCharacter: false, group: false, list: false, ttl: 3600, backdrop: false, input: null, trigger: "change", action: "click", searchListClass: "typeahead-search", jsonList: {} }, callback: { onInit: null, onHover: null, onHoverOut: null, onClick: null/*, onBeforeSubmit: null, onSubmit: null*/ }, debug: false