jeg har stadig problemer med at få den til at virke
min kode til siden med input på ser så dan her ud:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Autocomplete - Remote datasource</title>
<link rel="stylesheet" href="
http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="
http://code.jquery.com/jquery-1.9.1.js"></script><script src="
http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script><link rel="stylesheet" href="css/style.css" />
<style>
.ui-autocomplete-loading {
background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat;
}
</style>
<script>
$(function() {
function log( message ) {
$( "<div>" ).text( message ).prependTo( "#log" );
$( "#log" ).scrollTop( 0 );
}
$( "#bruger" ).autocomplete({
source: "autotest.asp",
minLength: 0,
select: function( event, ui ) {
log( ui.item ?
"Selected: " + ui.item.value :
"Nothing selected, input was " + this.value );
}
});
});
</script>
</head>
<body>
<div class="ui-widget">
<label for="bruger">bruger: </label>
<input id="bruger" />
</div>
<div class="ui-widget" style="margin-top: 2em; font-family: Arial;">
Result:
<div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
</div>
</body>
</html>
og min source side ser således ud:
<!--#include file="ssi/45tn73gf4347y.asp"-->
<html>
<body>
<%
strSQL = "SELECT * FROM `bruger` WHERE `Kunde navn` LIKE '%"&request.querystring("term")&"%'"
response.write strsql
set database = Con.Execute(strSQL)
do while not database.EOF
iResult = iResult + "{'value':'"&database("kunde navn")&"'}"
database.movenext
loop
response.write "["&(iResult)&"]"
%>
</body>
</html>