tags:

views:

42

answers:

4

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
A: 
<textarea readonly="true"></textarea>

just use readonly property

Update:

<textarea readonly>Some text</textarea>
RyuuGan
The `realonly` *attribute* accepts one, and only one, value — `realonly`. `true` is not acceptable.
David Dorward
@David Dorward : it's `readonly` but +1 anyway ;)
Chouchenos
http://www.w3schools.com/tags/att_textarea_readonly.asplooks like it would work
RyuuGan
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
ah... i see, thanks
RyuuGan
+1 for W3Schools. And, yeah, you can even write `readonly="false"` and would still be true :)
Chouchenos
+1  A: 

I think you need to know the readonly property.

Try here : link

Chouchenos
+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