FAQ Database Discussion Community


Highlighter Alternative Using Bootstrap Typeahead

javascript,jquery,twitter-bootstrap,typeahead
I'm currently using a bootstrap 3 typeahead module from https://github.com/bassjobsen/Bootstrap-3-Typeahead When a user searches, sometimes the suggestion returned does not actually contain any of the text they are searching for. For example, a user could be searching for Athletic Clothing and my search suggestion algorithm may return Nike to TypeAhead....

Strange behaviour Typeahead with remote JSON

javascript,jquery,ajax,typeahead.js,typeahead
I have a very strange behavior I'm trying to understand for the last couple of hours. I've made a self explaining JSFiddle that you can find here. Stackoverflow doesn't accept jsfiddle without code, so here we go... : $(function(){ var $el = $('#typeahead'); var resultsObj = {}; var resultsStrings =...

Typeahead format source

javascript,jquery,ajax,typeahead
I'm trying to use Typeahead. I'm using AJAX to get my source : $(document).ready(function() { $('input.typeahead').typeahead( { hint: true, highlight: true, minLength: 1 }, { source: function(query, process) { jQuery.ajax({ url: 'suggestion.php', dataType: "json", data: { type: 'abc' }, success: function(data) { suggestion = []; for(var i in data) {...

Disable button unless Selected from Typeahead Autocomplete

javascript,jquery,html,typeahead
--- EDIT: Explaining the Flow --- In the input field, the user is supposed to enter any string which is basically the name of a company they are searching for. Once the user has entered 3 or more characters, an AJAX call goes to the database, and fetches results matching...

typeahead not working with what seems to be identical JSON structure, but different data

jquery,typeahead
I have no idea why, but i have typeahead.js and using the example it works perfectly. But if i change the data, which looks the same, it does not work. I cannot understand why: var jdata_1 = [{ "urRouteName": "Test Route Name" }, { "urRouteName": "Beesmore Road" }]; var jdata...

Twitter typeahead on touch devices - what's the deal now?

javascript,ios,typeahead.js,typeahead,twitter-typeahead
So in their own docs they write that "mobile browsers aren't tested" and there are some bug tickets in which it is mentioned, that mobile browsers aren't supported (which isn't quite the same as just "not tested"). In another bug ticket it's said though that it seems to be compatible...

Async typeahead in Angular.JS do not show options

javascript,angularjs,bootstrap,typeahead
I looked at the official article and sample about Async typeahead. After I simplified and stubbed it and used in my project. angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('TypeaheadCtrl', function($scope, $http) { $scope.placeHolder = "Choose"; $scope.displayPath = "Name"; $scope.typeaheadminlen = 3; // Any function returning a promise object can be used to load values...

typeahead.js bloodhound minLength not working

typeahead.js,typeahead,bloodhound
I have implemented typeahead.js and bloodhound with a remote data source and it mostly works as expected. However, I have set the minLength on the typeahead to 2 and while I can see an ajax request fire after 2 characters (and 3), the typeahead only offers suggestions after 4 characters...

Angular typeahead using service

angularjs,service,typeahead
When I use a service, that returns a promise, typeahead doesn't work... In this plunk is possible to see the error... Using the first method (getLocation), the example works ok... but, when I try to use a service, as implemented in getLocation1, that returns a promise, it fails: TypeError: Cannot...

How to set javascript properties on a global listener, without duplicating code

javascript,parameters,call,bootstrap,typeahead
If I have multiple '.typeahead' input field on my page, and I want each of them to initialize typehead(), how can I make an exception for one specfic input element without duplicating my code? E.g.: My fields: <input type="text" class="typehead_selector" id="coworkers"> <input type="text" class="typehead_selector" id="jobs"> <input type="text" class="typehead_selector" id="search" data-action="search">...

twitter Typeahead input goes undefined when selecting

jquery,twitter-bootstrap,typeahead
I have a typeahead working fine, but when I select an entry, input is filled with "undefined" Any idea why ? Is there a "selecting" event or something that I can use to fill the input with the currently selected value ? I didn't found any information about this behavior...