August 10th, 2004, 04:01 AM
How to make a non editable text box in HTML
I want to make a text box as non-editable in an HTML document. But the content of the text should be visible by using the arrow keys, Home key, and End Keys (non editable). Also It should work in both Netscpae Navigator 6+ version and Internet Explorer 6+ version onwards.
August 10th, 2004, 04:06 AM
<textarea ... readonly="readonly"> ...
August 10th, 2004, 04:30 AM
Non editable Text box field in HTML
Try this code for non editable text box field in HTML.
<input type="text" name="name" readOnly="true">
This will work perfectly.
August 10th, 2004, 04:59 AM
In both the <textarea> as in in the in the <input type="text"> you should use the readonly attribute like:
Any other form is non standard. See http://www.w3.org/TR/html4/interact/forms.html#h-17.4
<input type="text" value="blah blah" readonly>
<textarea readonly>blah blah</textarea>
August 10th, 2004, 05:09 AM
if you're using XHTML, you must say readonly="readonly", not just readonly on its own.
Originally Posted by wsa1971
August 10th, 2004, 06:21 AM
Jbot is right, I was wrong. Sorry.