Home
Tutorials
Microsoft Technologies Tutorials
Java Programming Tutorials
Web Designing Tutorials
Script Programming Tutorials
Database Programming Tutorials
Mobile Technologies Tutorials
Other Programming Tutorials
Examples
Articles
Tools
News
AngularJS Radio Buttons Validation Example
Keywords : Angularjs radio buttons example, Angularjs validate radio button example, Angularjs get data from radio button selection example, Angularjs radio button list example
Example
<!DOCTYPE html> <html> <head> <title> AngularJS Radio Buttons Example with Validations </title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script> var app = angular.module('radibuttonApp', []); app.controller('radiobuttonCtrl', function ($scope) { $scope.checkoptions = function (choice) { if ($scope.selectVal!=undefined) $scope.msg = 'Selected Value: ' + $scope.selectVal; else $scope.msg = 'Please choose atleast one option'; }; }); </script> </head> <body ng-app="radibuttonApp" ng-controller="radiobuttonCtrl"> <div> <h3>AngularJS Radio Buttons Example with Validations</h3> <input type ="radio" name="userdetails" value="1" ng-model="selectVal" />Suresh<br /> <input type ="radio" name="userdetails" value="2" ng-model="selectVal" />Rohini<br /> <input type ="radio" name="userdetails" value="3" ng-model="selectVal" />Praveen<br /><br /> <input type="button" id="btnClick" value="Submit" ng-click="checkoptions()" /><br /><br /> <span style="color:Red">{{msg}}</span> </div> </body> </html>
Click Here to See Result
Result
Previous
Next