【问题标题】:Disable Fieldset in JqueryMobile在 JqueryMobile 中禁用字段集
【发布时间】:2013-06-04 00:18:26
【问题描述】:

如何在 Jquery Mobile 中禁用字段集,即不应触发输入上的点击事件,并且将子级的 UI 更新为禁用状态

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>

我已经尝试了以下

$("#options").children().attr("disabled", "disabled");
$("#options").children().prop("disabled", true);

但这不会禁用字段集中的所有子项。

【问题讨论】:

标签: jquery jquery-mobile


【解决方案1】:

看看这里:http://jsfiddle.net/nMR85/1525/

代码

$("#options input[type='radio']").checkboxradio('disable');

文档

http://jquerymobile.com/demos/1.2.0/docs/forms/radiobuttons/methods.html

【讨论】:

  • dis 完美地满足了我的需求。谢谢
猜你喜欢
  • 2017-10-19
  • 2021-02-14
  • 2017-02-18
  • 1970-01-01
  • 2012-01-15
  • 1970-01-01
  • 2014-10-16
  • 2010-10-21
  • 1970-01-01
相关资源
最近更新 更多