使用jquery,json和asp.net创建自动完成文本框的问题 [英] problem creating a auto complete textbox using jquery,json and asp.net
问题描述
您好我无法理解我在创建自动填充文本框时出错了。
这是我的jquery代码:
Hi I am not able to understand where I am going wrong in creating auto fill textbox.
Here is my jquery code:
function BindTexbox(data) {
debugger;
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#txt_membrid_name").autocomplete({
source: availabletags
});
}
这是我的HTML标记
And this is my HTML Markup
<input type="text" id="txt_membrid_name" class="tb" onkeyup="GetTxtBoxVal();" />
一切正常很好。我从我的onkey up事件中得到了反响,并且在成功时我进入了BindTexbox(数据)。
不知何故我的代码没有工作所以我尝试使用虚拟数组ie; availabletags。
但是每次我发现这个错误时,autocomplete都不是定义的方法。
我正在使用以下js文件:
everything works fine. I get respone from my onkey up event and on success I enter into BindTexbox(data).
Somehow my code wasn't working so I tried with dummy array ie; availabletags.
But every time I am geting this error autocomplete is not a method defined.
I am using following js files:
<script src="../../Scripts/Core/jquery-ui.js" type="text/javascript"></script>
<script src="../../Scripts/JS_UI_Effects/jquery.ui.widget.js" type="text/javascript"></script>
<script src="../../Scripts/JS_UI_Effects/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script>
<script src="../../Scripts/Core/jquery-1.8.3.js" type="text/javascript"></script>
<script src="../../Scripts/Core/jquery.ui.autocomplete.js" type="text/javascript"></script>
<link href="../../Styles/Content/themes/base/jquery.ui.autocomplete.css" rel="stylesheet"
type="text/css" />
请告诉我哪里出错了以及如何纠正它。我是JQuery的新手。
非常感谢。
Taresh
Please tell me where I am going wrong and how to rectify it. I am new in JQuery.
Many Thanks.
Taresh
推荐答案
( #txt_membrid_name)。autocomplete({
来源:availabletags
});
}
("#txt_membrid_name").autocomplete({ source: availabletags }); }
这是我的HTML标记
And this is my HTML Markup
<input type="text" id="txt_membrid_name" class="tb" onkeyup="GetTxtBoxVal();" />
一切正常很好。我从我的onkey up事件中得到了反响,并且在成功时我进入了BindTexbox(数据)。
不知何故我的代码没有工作所以我尝试使用虚拟数组ie; availabletags。
但是每次我发现这个错误时,autocomplete都不是定义的方法。
我正在使用以下js文件:
everything works fine. I get respone from my onkey up event and on success I enter into BindTexbox(data).
Somehow my code wasn't working so I tried with dummy array ie; availabletags.
But every time I am geting this error autocomplete is not a method defined.
I am using following js files:
<script src="../../Scripts/Core/jquery-ui.js" type="text/javascript"></script>
<script src="../../Scripts/JS_UI_Effects/jquery.ui.widget.js" type="text/javascript"></script>
<script src="../../Scripts/JS_UI_Effects/jquery-ui-1.8.7.custom.min.js" type="text/javascript"></script>
<script src="../../Scripts/Core/jquery-1.8.3.js" type="text/javascript"></script>
<script src="../../Scripts/Core/jquery.ui.autocomplete.js" type="text/javascript"></script>
<link href="../../Styles/Content/themes/base/jquery.ui.autocomplete.css" rel="stylesheet"
type="text/css" />
请告诉我哪里出错了以及如何纠正它。我是JQuery的新手。
非常感谢。
Taresh
Please tell me where I am going wrong and how to rectify it. I am new in JQuery.
Many Thanks.
Taresh
用urTQuery代码中的availabletags替换availableTags
replace availabletags in ur jQuery code with availableTags
这篇关于使用jquery,json和asp.net创建自动完成文本框的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!