2
<script type="text/javascript">
$(function() {
$("#searchTerm").autocomplete({
//appendTo:"#abc",
// position: { my : "right top", at: "right bottom" },
source: "home/search",
minLength: 1,
autoFocus: true,
select: function (event, ui) {
if (ui.item) {
$("#searchTerm").val(ui.item.value);
$("form").submit();
}
else { alert("abc")}
}
});
});
</script>
我嘗試了幾件事情,但不知何故我不能破解這個簡單的事情。在此先感謝想要添加警告如果searchTerm長度== 0