Click here to Skip to main content
15,850,751 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
Posted
Updated 24-Apr-16 22:40pm

1 solution

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
 
Share this answer
 
v2
Comments
Member 11061247 25-Apr-16 5:30am    
OK Thanx, I just applied it haven't got the solution but i'm still trying it.
Member 11061247 25-Apr-16 5:36am    
So if I want to use TextBoxes is it going to be possible to replace the button id with Textboxes if so How?
Nigam,Ashish 25-Apr-16 5:49am    
you can replace your textbox control Id in place of button.

document.getElementById('<%=yourTextboxId.ClientID %>').disabled = true;
Member 11061247 25-Apr-16 6:29am    
Thanx! applied it, give no errors but not performing anything but I will try figure out something coz i'm plugging it from ASP.MAKER.
THANX

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900