当文本进入第一个文本框时启用第二个文本框 [英] enable second textbox when text enters in first textbox

查看:92
本文介绍了当文本进入第一个文本框时启用第二个文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我在asp.net上工作c#



在我的网页上我有当我在Txtcountry中输入文本时,两个文本框为TxtCountry和TxtCity



.... TxtCity必须启用。否则Txtciuty必须禁用。



请帮助谢谢。

Hi friends,

am working on asp.net c#

on my webpage i have two textboxes as TxtCountry and TxtCity

when i enter the text in Txtcountry.... TxtCity must enable. otherwise Txtciuty must disable.

Please help thanks.

推荐答案

TextChanged 即使是第一个文本框(即txtcountry),只需启用txtcity ..

并在页面加载中使txtcity.enable = false ..



希望它能做到这一点..
In the TextChanged even of the first textbox(i.e txtcountry), just enable the txtcity ..
and in the page load make that txtcity.enable=false..

Hope it will do the trick..


试试这个希望它会对你有所帮助

try this hope it will help you
if(TxtCountry.Text=="")
{
    txtcity.enable=false;
}
else
{
    txtcity.enable=True;
}


您好,

您可以通过启用Txtcountry的keyup事件来实现。

Hi,
you can do it by enabling keyup event of Txtcountry.


这篇关于当文本进入第一个文本框时启用第二个文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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