I am trying to use the jQuery autocomplete
feature on an ASP MVC 3 web page. Unfortunately I keep getting this error. I've looked at version 1.9.2, which I'm using, and it does have the autocomplete method. I am, however, completely new to jQuery and not sure if there are too many declarations in the header, conflicting libraries, or missing ones.
Below is the code from the view
<link href="../../Content/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.8.3.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.tablesorter.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.js"></script>
<script type="text/javascript">
$(document).ready( function() {
$('#BankName').autocomplete('@Url.Action("GetBanks", "AgentTransmission")', {
dataType: 'json',
parse: function(data) {
var rows = new Array();
for(var i=0; i<data.length; i++){
rows[i] = { data:data[i], value:data[i].SignalName, result:data[i].SignalName };
}
return rows;
},
formatItem: function(row, i, n) {
return row.SignalName + ' - ' + row.Description;
},
width: 300,
mustMatch: true,
});
});
Full html can be found here: http://jsfiddle.net/qpvBv/