如何获取文本框 [英] how to get textbox

查看:73
本文介绍了如何获取文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下拉列表并有一些项目,例如a,b,其他.当我选择其他人时,我想显示一个文本框.能否在c#ASP.Net中发送代码
请把代码发送给我. [电子邮件已删除]
====
UPDATE SM:在这里发布您的电子邮件会邀请您发送SPAM

解决方案

没有人会向您发布代码!这是一个论坛,人们在这里发布他们的查询,而其他人则试图提供帮助.

如果需要在客户端进行操作-您需要将javascript附加到其他"选项,这将使文本框可见

如果需要在服务器端执行此操作,则可以在selectedIndex change事件中使该文本框可见,在该事件中可以检查是否选择的值为其他".

现在试试.万一您遇到问题,请提交您尝试过的代码,我们将为您提供帮助.可见= false.
在下拉列表的选定索引更改事件中,您可以仅检查文本其他",如果已选中,则使文本框可见.


您好
您可以在下拉列表的选定索引更改中编写以下代码

如果(dropdownlist.text ==其他")
{
textbox.visible = true;
}
其他
{
textbox.visible = false;
}

希望对您有帮助

问候
kumaran


i have a dropdownlist and having some items.e.g. a,b,others. when i am selecting others,i want to show a textbox.can u plz send code in c# ASP.Net
plz send me the code to my mail. [email removed]
====
UPDATE SM: Posting your email here is giving invitation to SPAM

解决方案

No One is going to post the code to you! It''s a forum where people post their queries and others try to help.

If you need to do it client side - What you need is to either attach a javascript to the ''other'' option that will make the textbox visible
or
If you need to do it server side - you can make the textbox visible in the selectedIndex change event where you can check if the value is selected is ''others''.

Try now. In case you face, issues... Post the code, that you had tried and we will help you.


u can just keep a textbox where u have to show it just make its property visible =false.
in the selected index change event of dropdown u can just check for the text "others", if it is selected make the textbox visible.


Hi
you can write the following code in the selected index change of the dropdownlist

if (dropdownlist.text == "others")
{
textbox.visible = true;
}
else
{
textbox.visible = false;
}

hope this helps u

regards
kumaran


这篇关于如何获取文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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