You might want to read the documentation:
http://www.devbridge.com/projects/au...ry/#how-to-use
The first example site listed on the home page for this script works the way you say you want. It's search box is:
Code:
<input type="text" accesskey="4" title="Search for Items Here" name="q" id="q" class="searchbox" value="" />
It's initialization is:
Code:
$(function () {
$('#q').each(SetupDefaultSearchText);
var onSelect = function (v, d) {
if (d) {
window.location = d;
} else {
$('#searchform').submit();
}
};
$('#q').autocomplete({ serviceUrl: '/handlers/autocomplete.ashx', width: 390, minChars: 2, onSelect: onSelect });
});
function SetupDefaultSearchText() {
var q = jQuery(this);
var txt = q.attr('title');
if (!txt) { return; }
var onFocus = function () { if (q.val() == txt) { q.val('').removeClass('input-inactive'); } };
var onBlur = function () { if (q.val() == '' || q.val() == txt) { q.val(txt).addClass('input-inactive'); } };
q.focus(onFocus).blur(onBlur);
onBlur();
}
The highlighted parts do not appear to be related to the autocomplete script.
Also that site uses version 1.1, you have version 1.1.5. Probably not important.
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
Bookmarks