Disabling Form Elements

<input type="text" name="username" id="username" value=""     placeholder="Username" class="ui-disabled" />

You can disable form elements by adding the ui-disabled class to them in the HTML definition or programmatically in your jQuery code. Disabling the elements prevents the control from accepting input from the user. Also, jQuery Mobile has special styling that is applied to disabled controls to make it apparent to the user that the form element cannot be used.

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.