### jQuery Mobile TextArea ReadOnly

To set a jQuery Mobile (jQM) textarea to ReadOnly, set the property readonly accordingly.
Note: In the latest version of jQM use prop instead of attr.
Example jQuery Mobile Message Dialog
Define the message dialog in the HTML Body Section
<div data-role=dialog id="dlgmessage" data-add-back-btn=false data-theme="a" data-overlay-theme="a" class="ui-content">
<div data-role=header>
<h1>Message</h1>
</div>
<div data-role=content>
<textarea name="fieldmessage" value="" id="fieldmessage"></textarea>
</div>
<div data-role="footer">
</div>
</div>
Set the readonly property of field "fieldmessage"
<script>
$( document ).ready(function() {
// Set fieldmessage to readonly
$("#fieldmessage").prop("readonly", true);
});
</script>
Notes:
All textareas readonly:
$('textarea').prop('readonly', true);
All text fields readonly:
$('input[type=text]').prop('readonly', true);
All text fields and textarea readonly:
$('input[type=text],textarea').prop('readonly', true);

Changed: , Category: WebApps jQuery Mobile, File: T6C282M2114.htm, ID: 2114