Click to See Complete Forum and Search --> : Disabled Text Box
orionbrock32
01-26-2007, 03:45 PM
Question....is there anyway to change the apearance of a disabled text box. I need to auto-populate a field in a form using javascript but I don't want the user to be able to change what is in the box. So i am trying to make the box easy to see but impossible to use.
ryanbutler
01-26-2007, 04:31 PM
<input type="text" name="foo" disabled>
orionbrock32
01-26-2007, 04:43 PM
I have that, what I am wondering is can you change it so that the text box looks like a normal textbox but cannot be changed by the user. I have a way for it to work in firefox but nothing for ie as of now.
<style type="text/css">
input {
color: black;
}
input[disabled] {color:black!important;}
</style>
<input type="text" name="finalDestination" disabled>
ryanbutler
01-27-2007, 09:31 AM
You mean like this:
<html>
<head>
<style type="text/css">
input {
border:1px solid black;
background-color:#fff;
}
</style>
</head>
<body>
<input type="text" name="finalDestination" disabled>
</body>
</html>