0

Could someone help me with changing opacity of disabled inputText?

<div class="ui-grid-col ui-grid-col-8">
        <p:inputText disabled="true" value="#{someValue}"/>
</div>                                               

In my css file I tried

.ui-state-disabled {
    opacity: 0.95;
    filter: Alpha(Opacity=95);
    cursor: default !important;
}

for example, but it has no effect at all, how can I make it work?

user9309329
  • 313
  • 3
  • 13
  • 3
    Possible duplicate of [How do I override default PrimeFaces CSS with custom styles?](https://stackoverflow.com/questions/8768317/how-do-i-override-default-primefaces-css-with-custom-styles) – Jasper de Vries Mar 05 '18 at 11:56

1 Answers1

0

You need to use javascript. add make a style for this with a special class. like:

.disable-input{
 opacity: 0.95;
 filter: Alpha(Opacity=95);
 }

then check the input if it's disabled:

var input = document.getElementById('inputId');
if(input.disabled){
 input.classList.add("disable-input");
}

Hope that help you