Click here to Skip to main content
15,920,801 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello i have a drop down in my page and want to focus that on a condition but the problem is that my drop down is disable and want to set focus for enable it. but in disable mode i can able to focus that.

What I have tried:

i have tried this for focus.

myddl.focus();

but it is not working in disable and working fine in enable mode
Posted
Updated 27-Feb-17 3:21am
Comments
[no name] 27-Feb-17 7:21am    
You can't focus a disabled control. That is what "disabled" means. And, you don't need to focus a control to enable it.
Karthik_Mahalingam 27-Feb-17 7:32am    
what is the point of focusing a disabled control?

1 solution

If you want to enable a control then you enable it. However, you cannot focus on a control that is disabled. You will have to enable it first and then set focus to it.
 
Share this answer
 

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