# How to indicate disabled text input with gray text

**URL:** <https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102>\
**Category:** User Experience\
**Tags:** experience-designer, 8-2-8, user-experience\
**Created:** [January 19, 2022, 3:49pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102 "2022-01-19T15:49:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NascoMan](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/nascoman/32/1502_2.png) [@NascoMan](https://forums.pega.com/u/NascoMan)\
**Post date:** [January 19, 2022, 3:49pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/1 "2022-01-19T15:49:46Z")

</div>

When a text input is conditionally disabled, I would expect a visual cue to the user that it is disabled. What I am observing is that the text input looks exactly the same, but the user is unable to type in it. Is there a way to make the box and label appear faded/gray? The only solution I see is to make two text inputs with different formats and show/hide each conditionally. Hopefully, there is a cleaner solution.

Example: when a button is disabled, the appearance changes to be faded and it is clear to the user that it is disabled.

---

<div class="post-metadata">

**Author:** ![abhilashpegaexpert](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@abhilashpegaexpert](https://forums.pega.com/u/abhilashpegaexpert)\
**Post date:** [January 19, 2022, 7:20pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/2 "2022-01-19T19:20:26Z")

</div>

@NascoMan You can write custom css for all the inputs to apply the same format when the input elements are disabled

input[readonly] {

background-color:lightgray;

color: #686868

}

---

<div class="post-metadata">

**Author:** ![NascoMan](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/nascoman/32/1502_2.png) [@NascoMan](https://forums.pega.com/u/NascoMan)\
**Post date:** [January 19, 2022, 8:22pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/3 "2022-01-19T20:22:51Z")

</div>

@Abhilash_K Hi, thank you for the response. This helps, but it is only coloring the input box itself. Is there a way to apply formatting to the text input label? I am playing around with some CSS to see if I can figure it out, but let me know if you have any ideas.

Note: I found that input[disabled] works for specifically disabled elements, rather than all read-only elements.

---

<div class="post-metadata">

**Author:** ![abhilashpegaexpert](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@abhilashpegaexpert](https://forums.pega.com/u/abhilashpegaexpert)\
**Post date:** [January 19, 2022, 8:59pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/4 "2022-01-19T20:59:20Z")

</div>

@NascoMan Dom structure for Label and Input element are siblings of the Parent div element. So if you want to differentiate the Disabled Text Label then you have to write the custom jquery script to scan for input[readOnly] elements and find the immediate sibling and make changes dynamically. I dont see any out of the box solution to make the Label looks like disabled format when the input elements are disabled or readonly.

---

<div class="post-metadata">

**Author:** ![NascoMan](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/nascoman/32/1502_2.png) [@NascoMan](https://forums.pega.com/u/NascoMan)\
**Post date:** [January 19, 2022, 9:15pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/5 "2022-01-19T21:15:25Z")

</div>

@Abhilash_K Okay, in that case it seems easier to create two equivalent text inputs with active/disabled styles and show/hide them as appropriate.

---

<div class="post-metadata">

**Author:** ![NascoMan](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/nascoman/32/1502_2.png) [@NascoMan](https://forums.pega.com/u/NascoMan)\
**Post date:** [January 19, 2022, 9:19pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/6 "2022-01-19T21:19:05Z")

</div>

@Abhilash_K One more thing: the “disabled” display in the demo here is what I am looking for. Is this what it looks like OOTB in Pega 8.6?

[https://design.pega.com/components/text-input/](https://design.pega.com/components/text-input/)

---

<div class="post-metadata">

**Author:** ![abhilashpegaexpert](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@abhilashpegaexpert](https://forums.pega.com/u/abhilashpegaexpert)\
**Post date:** [January 19, 2022, 9:41pm UTC](https://forums.pega.com/t/how-to-indicate-disabled-text-input-with-gray-text/2102/7 "2022-01-19T21:41:54Z")

</div>

@NascoMan Yeah this components are in Cosmos Library. Verify the Dom structure if the Cosmos component and Regular Pega 8.6 div generation. if the Label and Input are in the same node then you should be able to achieve it.
