vendredi 24 avril 2015

Clear input fields when checkbox is checked

I have a check box and two input fields. Either the check box has to be checked or the two input fields have to be filled in. I'm doing validation using Angular i.e. ng-show, ng-required.

When the checkbox is checked the two input fields are disabled i.e. ng-disabled="$parent.vm.selectAllDates".

Now I also have to clear any data that may have been entered into the textboxes.

The check box is not checked on page load. It is set in the controller like this: vm.selectAllDates = false;

Is there some way to clear the input fields when the check box is checked in Angular?




Aucun commentaire:

Enregistrer un commentaire