473,385 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to change the color of the text

hi to all

when ever i am setting the text field propery as disabled the color of the text is not that much clear to read. thats why i am requesting you people how can i chang color of dissabled text field.

regards
Apr 4 '07 #1
11 8181
drhowarddrfine
7,435 Expert 4TB
In what way are you doing this? Show the code.
Apr 4 '07 #2
here is my code

Expand|Select|Wrap|Line Numbers
  1. <HTML><BODY><br><br>
  2. NORMAL TEXT FIELD<input type=text value="NORMAL TEXT FIELD"><br><br>
  3. DISABLED TEXT FIELD<input type=text value="DISSABLED TEXT FIELD" disabled>
  4. </BODY>
  5. </HTML>
  6.  
see the difference i am using windows xp. the clarity of the text is not visible thats why i want to chang color of the text. is possible

regards
In what way are you doing this? Show the code.
Apr 4 '07 #3
KevinADC
4,059 Expert 2GB
maybe "readonly" will be more appropriate than "disabled".
Apr 4 '07 #4
AricC
1,892 Expert 1GB
maybe "readonly" will be more appropriate than "disabled".
Kevins got it add readonly="readonly" to the text box. Also, you may want to include the <form> tag to those input boxes if you are planning on doing some action with them.
Apr 4 '07 #5
how to change the text box colour using html/javascript.
once u move ur mouse pointer on text field or u click on text field , then color of text field shuold change
Dec 22 '07 #6
gits
5,390 Expert Mod 4TB
how to change the text box colour using html/javascript.
once u move ur mouse pointer on text field or u click on text field , then color of text field shuold change
hi ...

in case you want a pure css-solution you may have a look at the following simple example:

[HTML]<html>
<head>
<style type="text/css">
input#my_tb:hover, input#my_tb:focus {
border: 1px solid red;
background-color: lightyellow;
color: red;
}
</style>
</head>
<body>
<input type="text" id="my_tb" value="testtext"/>
</body>
</html>
[/HTML]
another way would be to do it with javascript ...

kind regards
Dec 22 '07 #7
Markus
6,050 Expert 4TB
how to change the text box colour using html/javascript.
once u move ur mouse pointer on text field or u click on text field , then color of text field shuold change
Using javascript you could do:
Expand|Select|Wrap|Line Numbers
  1. <input type="text" value="CHANGE COLOR" id="foo" name="bar" onfocus="this.style.color='red';"/>
  2.  
merry christmas :)

Edit:
if you wanted the color to revert back to whatever it was before:
Expand|Select|Wrap|Line Numbers
  1.                 <input type="text" 
  2.         value="CHANGE COLOR" 
  3.         id="foo" name="bar" 
  4.         onfocus="this.style.color='red';"
  5.         onblur="this.style.color='';"/>
  6.  
Dec 22 '07 #8
drhowarddrfine
7,435 Expert 4TB
gits example above would only work in a modern browser and not Internet Explorer. I'm off to a job and can't think of a solution for some reason.
Dec 22 '07 #9
gits
5,390 Expert Mod 4TB
gits example above would only work in a modern browser and not Internet Explorer. I'm off to a job and can't think of a solution for some reason.
hi ... sorry ... couldn't test it since i don't have an IE here ... i'm using a mac ;) ... it worked in FF and Safari ... but i as i said ... it is an example. i think IE would have problems with the hover and/or attribute selectors at all ... so we have to use a javascript solution (silly IE again :D )?

kind regards
Dec 22 '07 #10
drhowarddrfine
7,435 Expert 4TB
Yes. Stupid IE is more like it.
Neither focus or hover will work.
It sure seems like I've done a CSS solution before but I'M UNDER A LOT OF PRESSURE TODAY. :)
Dec 22 '07 #11
pbmods
5,821 Expert 4TB
Would this work?

Expand|Select|Wrap|Line Numbers
  1. input[disabled="disabled"]
  2. {
  3.     color: #990000;
  4. }
  5.  
Dec 22 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: Reply Via Newsgroup | last post by:
Folks, Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and...
6
by: Louise | last post by:
Hi I have written an HTML pages which does not have any colour specifying tags as far I know. When I view this in an Microsoft internet explorer browser it appears with a white background and...
34
by: Andrew DeFaria | last post by:
I thought this would be fairly straight forward but apparently it's not. Given the following html file: <!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en"> <html> <head>...
5
by: AFN | last post by:
I'm trying to set a submit button to change text and color when clicked. Like saying "please wait" instead of "submit" and then changing the background color and text color. All works, except for...
4
by: ACaunter | last post by:
Hi there, I was wondering if there was a way to change the font color of the text in the title bar... by default the title bar is that dark blue faiding into light blue and it has white text......
3
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change...
3
by: John Smith | last post by:
I'm looking into this peace of code: protected void DropDown_SelectedIndexChanged(object sender, EventArgs e) { DropDownList list = (DropDownList)sender; TableCell cell = list.Parent as...
2
by: John Smith | last post by:
Will this line of the code: item.Cells.Text = "Some text..."; change only DataGrid visual value or it will also change value in the DataSource? How can I change value in DataSource? ...
7
by: =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post by:
I want to change the font color and weight at a specific position in the text. I am not sure where or what I need to do. It will be at position 155/156 from the left on each line. Here is the...
18
by: wizdom | last post by:
Help - change text on click - text has another onclick inside with php variables ---------- I think what I'm trying to do is simple. I have a 2 buttons on a page. 1 button allows a thread of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.