First of all, your code is not wrapped inside $(document).ready()
. The following will not work as expected:
<script>
$("#outsideSales").dosomething();
</script>
<!-- Note: #outsideSales does not exist before this line -->
<input id="outsideSales">
Revise your code like this:
<script>
$(document).ready(function(){
$("#outsideSales").dosomething();
});
</script>
<input id="outsideSales">
#2: when you specify a URL as the source parameter, jQuery UI will send a request that contains the query string parameter term
. So you need to modify your code accordingly:
String outside = request.getParameter("term");
#3: the jQuery UI expects a valid JSON instead of a string. So instead of this:
[Jack, Jill, John]
Your program needs to output:
["Jack", "Jill", "John"]
PS: your query is open to SQL injection.