$(document).ready(function() { // Fix PNG transparencies on IE jQuery.ifixpng("images/pixel.gif"); $("img[src$=png]").ifixpng(); $("#product_search").autocomplete("http://www.oandp.co.uk/data_feed/products.php", { autoFill: false, cacheLength: 1, dataType: 'json', delay: 400, extraParams: { format: "json" // pass the required context to the Zend Controller }, formatItem: function(item) { return item.name; }, matchCase: false, matchContains: true, matchSubset: false, max: 10, minChars: 0, multiple: false, multipleSeparator: ",", mustMatch: false, parse: function(data) { var parsed = []; for (var i = 0; i < data.length; i++) { parsed[parsed.length] = { data: data[i], value: data[i].name, result: data[i].name }; } return parsed; }, scroll: false, scrollHeight: 180, selectFirst: false, width: ($("#product_search").width() + $(".product_search_button").width()) }); $("#product_search").defaultValue("Product Search / Code"); });