I'm using Jquery's autocomplete library, I think it works 50%, it does not generate an error but it does not show me the text of the matches it finds, they only appear as the rows where the text should go, not I know why ?
this is my code
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(function() {
function log( message ) {
$( "<div>" ).text( message ).prependTo( "#log" );
$( "#log" ).scrollTop( 0 );
}
$( "#city" ).autocomplete({
source: function( request, response ) {
$.ajax({
type:"post",
url: "coincidencia",
dataType: "json",
data: {
q: request.term
},
success: function( data ) {
response( data );
}
});
}
});
});
</script>
<div class="ui-widget">
<label for="city">Buscar </label>
<input id="city">
</div>
On the match page I generate a JSON string
@Code
Dim valor = Request.Form("q")
Dim queryBusca = db.Query("SELECT nombre FROM ADENDA WHERE nombre LIKE'" + valor + "%' GROUP BY nombre")
End Code
[
@Code
Dim i = 1
For Each item In queryBusca End Code
{ "nombre":"@item("razon_social")"
@Code If i <> queryBusca.Count Then End code
},
@code Else end code
}
@code
End If
End Code
@code
i = i + 1
Next
End Code
]