Click here to Skip to main content
15,887,888 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
make disabled dropdown as enabled(only look)
but disabled functionality should be same as it is
Posted
Comments
Thanks7872 5-Jun-14 8:08am    
Why? Its depends on how browser decides.
syna syna 5-Jun-14 8:13am    
In disable mode text color is different
I want that should be like active control text

1 solution

You can do in the following way :-

i) Create the style you want to set for the disabled combobox(similar to enabled text box).
Let say the class name is '.disabledNewStyle'.
ii) Get the disabled combobox in jQuery and add the new class to it.
Let say the disabled combobox ID is 'cmbDisabled'.

Now you can do like below :-

JavaScript
$( "#cmbDisabled:disabled" ).addClass('disabledNewStyle');

// also you can use '.css' method to add styles directly and make it '!important' to override previous styles.
JavaScript
$( "#cmbDisabled:disabled" ).css("color", "black !important");
$( "#cmbDisabled:disabled" ).css("border", "black !important");



Hope this will be of help, at least give you a hint to go in correct way.
 
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