Click to See Complete Forum and Search --> : Setting required color to the text of a DISABLED text field
sr_eda
08-06-2004, 02:37 AM
Hi all
I have a text field that contains some text. On some event I disabled this text field. Thereby the color of the text in this text field is changed to light brown color(i.e. default color of the disabled field).
How can I retain or get back the original color of the text that is there in this text box?
In other words is it possible to change the color of the text of a DISABLED text box? If it is possible please give me the ways to achieve this functionality.
Thanks & Regards
Eda
Pittimann
08-06-2004, 02:48 AM
Hi!
Why don't you use 'readonly' instead of 'disabled'?
Cheers - Pit
sr_eda
08-06-2004, 03:40 AM
Hi Pit
Thank you very much for faster response. But the scenario is as follows.
In our case once the text box is disabled, it should not be sent to the server when I submit the form. If I use readonly I cannot achieve this functionality. So we are using disable.
Please help me if you find any other alternative.
Regards
Eda
Pittimann
08-06-2004, 03:45 AM
Hi!
The problem is: IE will not accept a color attribute for a disabled textfield. Mozilla does it without a problem.
I would advise you, to use readonly before form submit and in your validation function, which you surely have, set the disabled attribute on validation success. So you'll have both desired effects: while the user is dealing with the form, the field in question will have the color you want and onsubmit of the form, the field will be disabled to avoid sending field name and value to the server.
Cheers - Pit
sr_eda
08-06-2004, 04:08 AM
Hi Pit
It is nice to receive such a good advice from you. I like the idea you suggested.
I will estimate the work involved in implementing this idea and proceed from there.
Thank you very much for your instantaneous help.
Regards
Eda
Pittimann
08-06-2004, 04:10 AM
Hi!
You're welcome! :)
If you face any problems in getting things work, just post again.
Cheers - Pit
steelersfan88
08-06-2004, 09:58 AM
What is it that you want to disable? Why just not make it a span element instead if it is really not input like the tag suggests?