Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Disable text in a JSP  RSS feed

 
Neha Sharma
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
When I use disabled = "true" the text 'disable' is shown on my text box if an empty string is passed for the value. I've pasted the code I'm writing. Suggest me how should I make uneditable text boxes.
<input type= "text" disabled = "true" size="9" name="newText" value = "" >
Neha
 
Yogen Vadnere
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this...
<input type=text value="javaranch" disabled>
 
Bryce Webster
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That will also only work for IE, Netscape does not support the disabled functionality.
 
Neha Sharma
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what's the reason if I don't pass any text then text 'Disabled' is printed, but if I pass the value in the text it works fine
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean what Yogen posted does not work in IE? if it does not try this...
<INPUT TYPE="text" DISABLED SIZE="whatever" MAXLENGTH="whatever" NAME="whatever" VALUE="whatever" >

Bosun
 
sanjay yermalkar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:
<input type=text name="ssn" onfocus="blur()" READONLY=true value="noedit">
It works in both IE and Netscape.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!