Meaningless Drivel is fun!*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 60740

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] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: readOnly disable style
Similar Threads
How to make a dynamaically created text field readonly?
Want to display non editable in a frame
text field uneditable
Servlet Security