根据VB.NET中的下拉选择启用/禁用文本框 [英] Enable/disable textbox based on dropdown selection in VB.NET
本文介绍了根据VB.NET中的下拉选择启用/禁用文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
早上
我有问题我想在组合框/下拉列表中选择下拉项后启用/禁用文本框。
< br $> b $ b
谢谢
我尝试了什么:
我尝试使用JavaScript它给出了错误我认为适用它需要一个VB.Net代码。
Morning
I have a problem I want to Enable/disable textbox after select dropdown item from combobox/dropdown list.
Thank you
What I have tried:
I tried using JavaScript it giving errors I guess applicable it need a VB.Net code.
推荐答案
如果您使用VB.Net作为语言,则可以使用Java脚本。
函数checkSelect()
{
if(document.getElementById('<%= ddlSte.ClientID%>')。value =='Select One')
document.getElementById('< %= StGoBtn.ClientID%>')。disabled = true;
else
document.getElementById('<%= StGoBtn.ClientID%>')。 disabled = false;
}
使用此功能。
Ashish
You can use Java script if you are using VB.Net as a language.
function checkSelect()
{
if (document.getElementById('<%=ddlSte.ClientID %>').value == 'Select One')
document.getElementById('<%=StGoBtn.ClientID %>').disabled = true;
else
document.getElementById('<%=StGoBtn.ClientID %>').disabled = false;
}
Use this function.
Ashish
这篇关于根据VB.NET中的下拉选择启用/禁用文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文