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の変数を使用することはできませんエラーが発生しますソース:「/problems/get_categories_ajax.php?category="+$(this).data("autocomplete」、ui.item.autocomplete)、私は値を取得できますか
ここにAJAX呼び出しを構築しようとしていますそこを通過するフォームから?
ありがとうございます!
'$(この).dataセクション( "オートコンプリート" を、 ui.item.autocomplete) 'はデータ=オートコンプリート値を設定し、それを取得しません。 – Joe
私は参照してください。私は完全に理解していない例から作業しています。このようなことをどのように働かせるかについて、ここでいくつかの指針を期待していました。 – GeekedOut