Hello everyone, I am going to share the code-sample to validate a check-box when click on any submit form button in angularjs apps. In the given angular check-box , by default ng-model value is false and after checked to check-box get the ng-model value is true. The behalf of the value true/false we are display the error messages on the form. The example detail as given below. The AngularJs code-sample var app = angular.module( 'validateApp' , []); app.controller( 'validateController' , function ($scope) { $scope.checkoutTerms = false ; //Default //Click function $scope.myClick = function (checkoutTerms) { alert( 'checkbox is validate : ' + checkoutTerms); }; }); The HTML code-sample < div ng-app ="validateApp"> < div ng-controller ="validateController"> ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers