文本框基于其他文本框自动完成 [英] Text box auto complete based on other text box

查看:92
本文介绍了文本框基于其他文本框自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有两个文本框,分别是州和城市.状态文本框和城市框具有ajax自动完成属性.现在,我的任务基于州文本"框,城市文本框应显示列表.怎么办?

在此先感谢.

Hi,

I have two Text boxes, namely State and City. State text box and City box are having ajax auto complete property. Now my task is based on the State Text box, the city text box should display the list. How is to do?

Thanks in Advance.

推荐答案

使用文本框TextChanged事件将选定的状态传递给sql查询,该查询将数据检索到CIty TextBox.

为此,您应该将State TextBox的PostBack属性设置为TRUE.



另一个建议是:如果不是您的客户端要求,则使用下拉列表而不是文本框来克服复杂性是更好的选择
Using Textbox TextChanged Event pass the State selected to the sql query which retrieves data to the CIty TextBox.

For this u should set the PostBack Property of State TextBox to TRUE.



Another suggestion is: It is better to use dropdown lists instead of textboxes to overcome the complexity if using Ajax Auto Complete textbox is not your client requirement


function ace_allSearchCity() {
            var nam = '';
            var para = 'maincity' + '


'+ document.getElementById('<% = hdnPropState.ClientID %> ').value +'
' + document.getElementById('<%=hdnPropState.ClientID%>').value + '


这篇关于文本框基于其他文本框自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆