Reputation: 1002
How do I disable a fieldset in Jquery Mobile i.e. the click event on the input should not fire and the UI updated for the children to a disabled state
HTML
<fieldset data-role="controlgroup" id="options">
<input type="radio" name="radio-choice-1" id="optiona" value="a" checked="checked">
<label for="optiona" id="labela">Ondo</label>
<input type="radio" name="radio-choice-1" id="optionb" value="b">
<label for="optionb">Lagos</label>
<input type="radio" name="radio-choice-1" id="optionc" value="c">
<label for="optionc">Abuja</label>
<input type="radio" name="radio-choice-1" id="optiond" value="d">
<label for="optiond">Kogi</label>
<input type="radio" name="radio-choice-1" id="optione" value="e">
<label for="optione">Niger</label>
I have tried the following
$("#options").children().attr("disabled", "disabled");
$("#options").children().prop("disabled", true);
But this does not disable all the children in the fieldset.
Upvotes: 1
Views: 1325
Reputation: 17927
have a look here: http://jsfiddle.net/nMR85/1525/
code
$("#options input[type='radio']").checkboxradio('disable');
docs
http://jquerymobile.com/demos/1.2.0/docs/forms/radiobuttons/methods.html
Upvotes: 2