Last active
September 26, 2018 14:48
-
-
Save clubeagn/ce5d05f386cb435084817a4306f97f6a to your computer and use it in GitHub Desktop.
Typeahead JS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form-group col-md-6"> | |
{{ Form::label('XXXXXXX','XXXXXXX')}} | |
{{ Form::input('text','XXXXXXX', null, array('class' => 'form-control', 'autocomplete' => 'off')) }} | |
</div> | |
<script> | |
$(function () { | |
$("#XXXXXXX").typeahead({ | |
items: 4, | |
source: function(request, response) { | |
$.ajax({ | |
url: "{{ route('SUA-ROTA-LARAVEL-JSON') }}", | |
dataType: "json", | |
success: function (data) { | |
console.log(data); | |
response(data); | |
} | |
}); | |
}, | |
autoSelect: true, | |
displayText: function (item) { | |
return item.RETORNO_DO_BANCO; | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment