javascript - Disable jQuery button - no recipes still -


browse internet find how disable button:

<td valign="center" halign="left"><a href="#" id="save-user" data-role="button" data-inline="true" data-theme="b" data-icon="check">save</a></td> 

there of recipes no result:

$('#operator-modify').ready( function () { // none of below disable button //$("#save-user").attr("disabled", true).button("refresh"); //$('#save-user').addclass('ui-state-disabled').attr('disabled', true); //$('#save-user').attr('disabled', 'disabled').addclass( 'ui-state-disabled'); }); 

finally - how enable / disable button?

the jquery mobile has several types of buttons. first 1 "basics" page <a data-role="button">. type of buttons can disabled applying .ui-disabled class:

$('#operator-modify').ready( function () {    $('#save-user').addclass('ui-disabled'); }); 

there note links styled button in documentation.

note: links styled buttons have same visual options true form-based buttons below, there few important differences. link-based buttons aren't part of button plugin , use underlying buttonmarkup plugin generate button styles form button methods (enable, disable, refresh) aren't supported. if need disable link-based button (or element), it's possible apply disabled class ui-disabled javascript achieve same effect.

other type of buttons <input type="button"> , <button>. type of buttons can disabled calling "disable" method of "button" widget.

$('#operator-modify').ready( function () {    $('#save-user').button('disable'); }); 

complete example: http://jsfiddle.net/xh7w3/3/


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -