Login
Sign Up
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
Home
Examples
Angularjs Examples
AngularJS Radio Buttons Validation Example
AngularJS Radio Buttons
AngularJS Radio Buttons Validation Example
Posted On : 11 May 2016
Total Views : 2834
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="http://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 Output
Output
Share this example
PREVIOUS
AngularJS Check if Checkbox Checked Unch...
NEXT
AngularJS Bind Array to Radio Button List Exa...
Topics Covered
Search Terms
×
SIGN IN
Thanks to Register with tutlane.com
We sent verification mail to your registered email address to activate your account.
Please check your mail inbox in case if it not there check it in spam / junk folder
Email Address
Password
Lost Password?
Sign In
Dont have an Account yet?
Sign Up
Full Name
Email ID
Password
Re-enter Password
Register
Already have an account?
Sign In
Enter the email you used in your Tutlane profile. We will send your details.
E-mail Address
Submit
An Email has been sent with your account information. Please check your email and login
Already have an account?
Sign In