Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

readOnly disable style

 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I make text in a readOnly field look exactly like text in a disabled field.

Thanks
 
Shrikumar Vadivelu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, set readonly="readonly" in ur textfield.

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

Thanks & Regards,
--Sri.
 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic