Solution 1 :

Problem solved. I’m using typeahead:select for my cases. Thanks

Problem :

I want to fill some value to another input text. how to do that?

var projects = new Bloodhound({
    datumTokenizer: function(d) { return Bloodhound.tokenizers.whitespace(d.idSales); },
    queryTokenizer: Bloodhound.tokenizers.whitespace,
    remote: {
        url: '<?php echo BASE_URL() ?>Sales/getSalesAll?query=%QUERY',
        wildcard: '%QUERY'

        hint: true,
        highlight: true,
        minLength: 0
        name: 'projects',
        display: function(item){ return item.idSales+' – '+item.namaSales},
        source: projects.ttAdapter(),
        templates: {
            empty: [
            suggestion: Handlebars.compile('<p>{{namaSales}} - {{email}}</strong> </p>')

Here is the html code :

<div class="search-form wd-lg-100p">
    <input id="listSales" name="idSales" type="search" class="form-control" placeholder="Enter sales name" required>
    <input id="emailSales" name="emailSales" class="form-control" value="" disabled>

So after im select a value from typeahead #listSales, then the email value auto fill the #emailSales.
how to do that? thank you