Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable text box without grey

Status
Not open for further replies.

hazg

Programmer
Dec 14, 2004
10
FR
Hello,

Is there a way of disabling a textbox so it cannot be changed without the text being grayed out????

Heres what ive got:

<input type=text disabled id=desc size=60>

Thanks
 
Yes it is. It is readonly.
Code:
<input type="text" id="desc" size="60" [b]readonly="readonly"[/b] />
[code]
Should work in the currently used browsers, older browsers (4) lack support.
 
Thanks a lot! I have sorted it now!
 
Another way:

Code:
<input type="text" name="t1" onfocus="this.blur();" />

*cLFlaVA
----------------------------
[tt]insert funny quotation here.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top