0

I have a textbox in my function which I have disabled with field.disabled=true.

Now I want the color in black instead of grey

I have written a function, inside the function I have disabled the field and by default it's in the color grey, I want that color as black field.disabled = true

I have tried, field.style.color="black"; but that did not seem to work.

I have tried field.style.color="black"; this also doesn't seem to work.

I have received the value in a variable(field) and I have disabled the text box value. My problem is that it is looking properly, so I need that color as black.

Marco Geertsma
  • 803
  • 2
  • 9
  • 28

2 Answers2

0

use readonly instead of disabled then style them as you want. Check here for more info Changing font colour in Textboxes in IE which are disabled

Community
  • 1
  • 1
codetantrik
  • 315
  • 2
  • 9
0

You can do as follows

<style type="text/css">
.disableinputColor
{
    color:black;
}
</style>
    <script type="text/javascript">

    function changeColor()
    {
        var el = document.getElementById('YourDisabledTextId');
        el.className = "disableinputColor";
    }
</script>

I think you disabled the textbox using javascript (dynamically) so better to change color of textbox from javascript Hope it Helps..

BhavikKama
  • 8,566
  • 12
  • 94
  • 164