I want one scrollable text area which is disabled.Means user can scroll to see the contents of the text area but will not be able to edit it.
A:
the easiest way would be to use "readonly" instead.
another way would be to use a fixed-height div will overflow:scroll
that looks like a textarea but isn't.
oezi
2010-10-22 08:11:23
A:
<textarea readonly="true"></textarea>
just use readonly
property
Update:
<textarea readonly>Some text</textarea>
RyuuGan
2010-10-22 08:11:59
The `realonly` *attribute* accepts one, and only one, value — `realonly`. `true` is not acceptable.
David Dorward
2010-10-22 08:17:40
@David Dorward : it's `readonly` but +1 anyway ;)
Chouchenos
2010-10-22 08:26:21
http://www.w3schools.com/tags/att_textarea_readonly.asplooks like it would work
RyuuGan
2010-10-22 08:26:32
Ooops. Typo :) (a) W3Schools is crap. (b) It happens to be OK here, it lists one value — `readonly`, not `true`, not `1`, not `yes` just `readonly`. The example uses `readonly` and the word `true` doesn't appear anywhere on the page.
David Dorward
2010-10-22 08:29:12
ah... i see, thanks
RyuuGan
2010-10-22 08:30:12
+1 for W3Schools. And, yeah, you can even write `readonly="false"` and would still be true :)
Chouchenos
2010-10-22 11:13:15
+1
A:
I think you need to know the readonly
property.
Try here : link
Chouchenos
2010-10-22 08:13:07
+3
A:
Why use a <textarea>
if user can't edit it ?
A simple <div>
would do the trick with fixed height and overflow:auto;
MatTheCat
2010-10-22 08:13:22