ajax自动完成值问题 [英] ajax auto complete value problem
问题描述
<script>
jQuery(function() {
$("#itemname").autocomplete("AutoComp?mode=itemName");
});
</script>
此功能正常工作。
但如果我使用该文本框值,则不会选择完整值,它只需要我输入的文字。
我想在文本框中通过自动完成生成文本的全部值。
当我单击文本框时,该值将转到数据库并获取不同的值并将该值放在另一个文本框中。
谢谢。
This function working fine.
But if I use that text box value it not pick full value, it takes only what are the text i entered.
I want full value of text in the text box which are generated by auto complete.
When I click text box that value will go to database and fetch different value and place that value in another text box.
Thank You.
推荐答案
( #itemname)。autocomplete(< span class =code-string> AutoComp?mode = itemName);
});
< / script>
("#itemname").autocomplete("AutoComp?mode=itemName"); }); </script>
此功能正常工作。
但如果我使用该文本框值,则不会选择完整值,它只需要我输入的文字。
我想在文本框中通过自动完成生成文本的全部值。
当我点击文本框时,该值将转到数据库并获取不同的值并将该值放在另一个文本框中。
谢谢。
This function working fine.
But if I use that text box value it not pick full value, it takes only what are the text i entered.
I want full value of text in the text box which are generated by auto complete.
When I click text box that value will go to database and fetch different value and place that value in another text box.
Thank You.
你可以尝试Ajax Auto完成,我使用过这种类型。我希望这完全用于
you can try Ajax Auto complete, i have used this type. I hope this is use full to
<asp:textbox id="Txt_location" runat="server" class="search_job2" value="Location" onfocus="if(this.value=='Location')this.value='';" onblur="if(this.value=='')this.value='Location';" xmlns:asp="#unknown"></asp:textbox>
<asp:autocompleteextender id="AutoCompleteExtender1" xmlns:asp="#unknown">
runat="server" DelimiterCharacters="" Enabled="True"
MinimumPrefixLength="1" ServiceMethod="City"
ServicePath="" TargetControlID="Txt_location"
UseContextKey="True">
</asp:autocompleteextender>
和代码隐藏方法是
and code behind method is
[WebMethod]
public static string[] City(string prefixText, int count, string contextKey)
{
DataTable dt = new DataTable();
dt = Bal_BindingData._job_category(prefixText);
string[] movies = new string[dt.Rows.Count];
for (int i = 0; i < dt.Rows.Count; i++)
{
movies[i] = dt.Rows[i]["Catagary_Name"].ToString();
}
return movies;
}
任何查询回复
for any query hit to reply
这篇关于ajax自动完成值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!