3

how can i make checkbox disable when i choose an item from comboboxes. forexample if i choose "ABONE", angular will make abone checkbox disable.

Note(example): DefinitionType : ABONE

enter image description here

                  <div class="row">
                <div class="form-group">
                    <label class="control-label col-md-2">Tanım Tipi<sup>*</sup></label>
                    <div class="col-md-3">
                        <select class="form-control" placeholder="Tanım Tipi" ng-options="field.value for field in DefinitionTypes" ng-model="DefinitionType"  required></select>
                    </div>
                </div>
            </div><br />  

Ekstra Tanım Tipi

                        <div class="checkboxinsameline" ng-repeat="item in DefinitionTypes">
                            <label>
                                <input type="checkbox" name="item.value" ng-click="DefinitionTypesChecked(item.id)" > {{item.value}}
                            </label>
                        </div>

                    </div>
                </div>
            </div><br />
1
  • You would add the attribute disabled="{{isDisabled}}" to the checkbox and then manage the value of isDisabled in the controller based on what is clicked in the drop down. Commented Aug 27, 2015 at 8:49

1 Answer 1

6

You will have to add this attribute on your input :

ng-disabled="item.value == DefinitionType.value"

This will disable your input when the value of your input will be equals to the value of your select model.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.