Autocomplete list passed in from HTML input tag not showing
I am using the followng default autocomplete code passing in a variable that consists of a list of XML filenames, but the list is not showing up in the autocomplete box. The jquery code is also interpreting the variable as a literal instead of the values which are the XML filenames.
Can you suggest fixes for both ot the issues?:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Autocomplete - Default functionality</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$( function() {
$( "#tags" ).autocomplete({
source: $('#txtEmail').val();
});
} );
</script>
</head>
<body>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
<input type="text" id="txtEmail" class="textbox" value={{msg.payload}}>
</div>
</body>
</html>