• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to Disable text in a JSP

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this...
<input type=text value="javaranch" disabled>
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic