Bootstrap: Fieldset enable/disable with radio button

杀马特。学长 韩版系。学妹 提交于 2019-12-07 22:15:46

问题


I'm currently using Bootstrap 3. From bootstrap documentation, I found that fieldset can enable and disable the form field. So, how can I Turn On and Off with the radio controls?

HTML Radio Controls

<form>
  <div class="form-inline">
    <label for="inputPassword" class="col-sm-6  control-label content_label" 
            style="margin-right:20px"> Do you want to change password ? </label>
    <div class="radio">
      <label>
        <input type="radio" name="optionsRadios" id="optionsRadios1" 
                value="option1" >
          Yes
      </label>
    </div>
    <div class="radio" style="margin-left:10px;">
      <label>
        <input type="radio" name="optionsRadios" id="optionsRadios2" 
              value="option2" checked>
              No
      </label>
    </div>
  </div>
</form>

回答1:


Just disable the fieldset with JQuery.

Here's a working example: http://www.bootply.com/120507



来源:https://stackoverflow.com/questions/20141757/bootstrap-fieldset-enable-disable-with-radio-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!