Hello i have this form with autocomplete and thymeleaf
<script type="text/javascript" th:inline="javascript">
/*<![CDATA[*/
$(function(){
var currencies = [];
/*[# th:each="n : ${Locations}"]*/
currencies.push( {'value':"[(${n.name})] [(${n.address})]", 'Id':"[(${n.id})]"} );
/*[/]*/
$('#autocomplete').autocomplete({
lookup: currencies,
onSelect: function (suggestion) {
var Id = suggestion.Id;
var requestData = { Id: Id };
yada.ajax([[@{/opinion}]], requestData, function(responseText, responseHtml) {
$('div.Inner').replaceWith(responseHtml);
yada.initHandlersOn(responseHtml);
});
}
});
});
/*]]>*/
</script>
<div id="searchfield">
<form>
<i class="glyphicon glyphicon-search"></i>
<input type="text" name="weblocation" class="biginput" id="autocomplete" placeholder="Search">
</form>
</div>
I want to display message, if no match terms : No result!
how can I do?
I found the solution:
$('#autocomplete').autocomplete({
showNoSuggestionNotice: true,
noSuggestionNotice: 'Not result',
Use noSuggesionNotice from devbridge guide : https://github.com/devbridge/jQuery-Autocomplete/pull/341/files?short_path=0730bb7