在自动完成搜索中遇到问题 [英] facing problem in autocomplete search
本文介绍了在自动完成搜索中遇到问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有 gridview
控制...在每个添加按钮上单击我创建新行并在每个删除按钮上单击我删除每行中的最后一行...有一个文本框...在这个文本框中我想自动完成搜索...但我收到一个错误...
这是我的代码:
function automember( eval ){
alert( eval .value);
alert( eval .id);
调试器;
$( eval .id).autocomplete({
source: function (请求,响应){
$ .ajax({
type: POST,
contentType: application / json; charset = utf-8,
url: / InputSheet.aspx / GetAutoCompleteTour,
data: {'selCo':' + document 。 getElementById( eval .id).value + '} ,
dataType: json,
成功: 功能(数据){
response(data.d);
},
错误: function (结果){
alert( 错误);
}
});
}
});
}
请帮帮我...
解决方案
< blockquote>( eval .id).autocomplete({
source: function (request,response ){
.ajax({
type: POST ,
contentType: application / json; charset = utf-8 ,
url: / InputSheet.aspx / GetAutoCompleteTour,
数据: {'selCo':' + document .getElementById( eval .id).value + '},
dataType: json,
成功:功能 (数据){
response(data.d);
},
错误: function (结果){
alert( 错误);
}
});
}
});
}
请帮帮我...
在你的网站中加入jQuery页。您将解决此问题。
< 脚本 类型 = text / javascript src = Scripts / jquery-1.8.2.js language = javascript > < / script >
i have a gridview
control...on each add button click i create new row and on each delete button click i delete the last row...in each row there is a text box...in this textbox i wanna autocomplete search...but i get a error...
this is my code:
function automember(eval) {
alert(eval.value);
alert(eval.id);
debugger;
$(eval.id).autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "/InputSheet.aspx/GetAutoCompleteTour",
data: "{'selCo':'" + document.getElementById(eval.id).value + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error");
}
});
}
});
}
please help me out...
解决方案
(eval.id).autocomplete({ source: function (request, response) {
.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "/InputSheet.aspx/GetAutoCompleteTour", data: "{'selCo':'" + document.getElementById(eval.id).value + "'}", dataType: "json", success: function (data) { response(data.d); }, error: function (result) { alert("Error"); } }); } }); }
please help me out...
Include jQuery in your page. You will resolve the issue.
<script type="text/javascript" src="Scripts/jquery-1.8.2.js" language="javascript"></script>
这篇关于在自动完成搜索中遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文