I have a form with three radio buttons in a group. The third radio button is \"Other\" and has a text field where the user can enter something in. I can make the radio button r
You can use ng-required. Something like
should work.
Regarding your other issue, you have to employ some controller-logic and some kind of temporary variable for form.OtherProgram
, using $watch for example.
$scope.$watch('form.Program', function(mVal){
if (angular.isUndefined($scope.form)) return;
if(mVal === 'other'){
$scope.form.OtherProgram = $scope.tmVar;
} else {
if($scope.form.OtherProgram !== null){
$scope.tmVar = $scope.form.OtherProgram;
$scope.form.OtherProgram = null;
}
}
});
Plunker: http://plnkr.co/edit/npvUXpRhB5MYJOstwd88?p=preview