var cssLink = "/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/css/autosuggest_inquisitor.css"; //var jsLibraryLink = "/is-bin/intershop.static/WFS/Reedy-PartsTown-Site/-/en_US/javascript/autosuggestion.js"; document.write(""); jQuery( function() { //==================== Search With all plugins ================================================= // Set autosuggest options with all plugins activated var options = { script: "http://www.partstown.com/is-bin/INTERSHOP.enfinity/WFS/Reedy-PartsTown-Site/en_US/-/USD/jsonAutoSuggest-SkuSearch?Limit=10&", varname:"input", json:true, // Returned response type shownoresults:true, // If disable, display nothing if no results noresults:"No Results", // String displayed when no results maxresults:10, // Max num results displayed cache:false, // To enable cache minchars:3, // Start AJAX request with at leat 2 chars timeout:1000, // AutoHide in XX ms callback: function (obj) { // Callback after click or selection // For example use : // Build HTML //var html = "ID : " + obj.id + "
Main Text : " + obj.value + "
Info : " + obj.info; //$('#input_search_all_response').html(html).show() ; // => TO submit form (general use) jQuery('#order_now_sku1').val(obj.id); } }; // Init autosuggest for 30 input fields on OrderNow page var arraySug = {}; for(var i=1; i<=30; i++) { var as_json = new bsn.AutoSuggest('order_now_sku'+i, options); arraySug[''+ i] = as_json; jQuery('#order_now_sku' + i).blur( function(){ for(each in arraySug) { arraySug[each].clearSuggestions(); } return true; } ); } });