my dog learned polymorphism
The moose likes HTML, CSS and JavaScript and the fly likes readOnly disable style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "readOnly disable style" Watch "readOnly disable style" New topic

readOnly disable style

Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 258
How do I make text in a readOnly field look exactly like text in a disabled field.

Shrikumar Vadivelu

Joined: Sep 14, 2005
Posts: 14
Hi, set readonly="readonly" in ur textfield.

like, <input type="text" name="aaa1" readonly="readonly" MAXLENGTH="4" value="991" size="8">

Thanks & Regards,
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 258
sorry is should have been clear earlier. I know how to set it to readOnly. just wanted to know style'wise' what do i add to the element so it 'looks' like disabled.
for example 'font-color' etc.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Simply apply the appropriate CSS styles to the element.

You will find more CSS tutorials on the net than you will know what to do with.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: readOnly disable style
It's not a secret anymore!