Set style only on enabled text boxes

I want to set the style only on enabled text boxes. If they are disabled I want the default style to prevail.

I tried this but it doesn't seem to work:


input[type="text"][enabled]


Is this proper syntax and I'm just missing something elsewhere?


This does work for disabled text boxes:

input[type="text"][disabled]



janeworleyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

LZ1Commented:
This is what I use for all my forms to make them more user accessible.  You can tailor it to your specific application obviously by just changing the CSS.

input[type="text"],
input[type="file"],
input[type="password"],
textarea,
select{
	border: 1px solid #9db4bd;
	width: 300px;
	padding: 7px;
	font: 16px Verdana, Geneva, sans-serif;
	color: #CCC;
	background: url(../images/trans_wht.png);
}

input[type="text"]:focus, 
input[type="text"].focus,
input[type="password"]:focus, 
input[type="password"].focus,
select:focus,
select.focus,
textarea:focus,
textarea.focus{
	border: 1px solid #333;
	padding: 7px;
	background: #FFF;
	color: #333;
	font: 16px Verdana, Geneva, sans-serif;
	width: 300px;
}

Open in new window

0
janeworleyAuthor Commented:
I think your code will apply the styles on disabled fields as well as enable ones?
0
LZ1Commented:
Yes.  The focus is when someone is typing in the field.  The other is the default styling when it's idle.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.