Copying and setting Radio Buttons using OnChange event

Selection of radio buttons from first group will set the matching selection of second group of radio buttons.

One Two Three
--- 2nd group --
First ( One ) Second ( Two ) Third ( Three )

Your selection is {{class}}
<div ng-app="my_app" ng-controller="my_ctrl">
<div class="container"><div class="row"><div class="col-3">
<input type=radio ng-model="class" value="One" ng-change="onChange()"> One 
<input type=radio ng-model="class" value="Two" ng-change="onChange()"> Two
<input type=radio ng-model="class" value="Three" ng-change="onChange()"> Three
</div><div class="col-3">
--- 2nd group -- 
</div><div class="col-6">
<input type=radio ng-model="class2" value="One" > First ( One )
<input type=radio ng-model="class2" value="Two"> Second ( Two )
<input type=radio ng-model="class2" value="Three"> Third ( Three )
</div>
</div></div>
<br>
Your selection is {{class}}
</div>
<div class='alert alert-primary' role='alert' id=d1>After selection details will appear here</div>
<script>
var app = angular.module('my_app', []);
app.controller('my_ctrl', function($scope) {
 $scope.onChange = function()
{ 
 $scope.class2=$scope.class;	
 document.getElementById('d1').innerHTML="Your Selection: " + $scope.class;
 
} 
    
});
</script>


Radio buttons

Angular Home

Post your comments , suggestion , error , requirements etc here

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer