Apex: How to Disable a Text Area ?
Every application contains pages where the data should be displayed in read-only mode.
For a normal text item, you can declare a field as “Display as Text Item (does not save state)” and the value is shown as HTML
(see Text 1).
For a multi-line text area there is not a similar option.You can leave it as such by defining it as “Textarea (auto-height)”
(see Text 2).
This can be confusing because the enduser can edit the field and have the impression that he may change the content.
Another possibility is to set on the Element-level for that textarea-field the HTML Form Element Attributes to “disabled“.
The disadvantage of this solution is that the scrollbar disappears; so, when you are dealing with a large textextract, you may not see the complete content (see Text3).
Javascript can help us to resolve this problem. By defining the two following steps, you can scroll within the textarea, but you may not change the text
(see Text 4):
Great Idea. Might be a bit cumbersome for many fields on a page. Still a good option.
You just can put the text: readonly into the HTML Form Element Attributes field. No javascript needed !
If I’m not missing your point, you can set the ‘readOnly’ attribute of the textarea to False.http://blog.onursafak.com