0
에서 현재 텍스트를 얻을 방법을 잘 :의 jQuery 자동 완성 기능 - 나는 현재 내 자동 완성 jQuery 코드에서 이런 일이 필드
$("input#autocomplete").autocomplete({
source: "/problems/get_categories_ajax.php?category="+$(this).data("autocomplete", ui.item.autocomplete),
delay: 0,
minLength: 0,
autoFocus: true,
select: function (event, ui) {
$("#user_id").val(ui.item.id);
$(this).data("user_id",ui.item.id);//Store arbitrary data associated with the specified element
$(this).data("username",ui.item.value);//Store arbitrary data associated with the specified element
},
selectFirst: true,
autoFill: true,
mustMatch: true
})
.bind("blur",function() {
var autocomplete = $(this).data("autocomplete");
$(this).val(autocomplete);
$("#autocomplete").val(autocomplete);
});
하지만 난 때 UI를 변수를 사용할 수 없습니다 오류 여기에 AJAX 호출을 작성하려고합니다. source : "/problems/get_categories_ajax.php?category="+$(this).data("autocomplete", ui.item.autocomplete),
어떻게 값을 얻을 수 있습니까? 거기서 지나가는 양식 에서요?
감사합니다.
'$ (이) .DATA ("자동 완성" ui.item.autocomplete)'데이터 = 자동 완성 값을 설정하고, 그것을 검색하지 않습니다. – Joe
있습니다. 나는 단지 내가 완전히 이해하지 못하는 모범에서 일하고있다. 이런 종류의 일을 어떻게 작동 시킬지에 대한 지침을 얻기를 바랬습니다. – GeekedOut