Bootstrap: Fieldset enable/disable with radio button

user3001055 picture user3001055 · Nov 22, 2013 · Viewed 8.1k times · Source

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>

Answer

Sean picture Sean · Mar 10, 2014

Just disable the fieldset with JQuery.

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