Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Form Validation throgh Angular js

 i am searching on internet then found many missing thing on Validation on form when you are beginner and learning in angular js
I am follow few step of validation of angular js then validate my form. validation script
   var d = angular.module('myapp', []);
d.controller('HomeController', function($scope) {
$scope.loginForm = {
UserName: '',
password: '',
email: '',
Gender: [{
value: 0,
text: '--select--'
}, {
value: 1,
text: 'Male'
}, {
value: 2,
text: 'female'
}]
}
$scope.form = $scope.loginForm.Gender[0].value

$scope.validate = function(model) {

$scope.form1.$submitted = true;
$scope.selectedGender = document.getElementById('ddlGender').value == '0'
if ($scope.selectedGender) {
return false;
}
if ($scope.form1.$valid) alert(1);

}
$scope.onSelectChange = function() {
$scope.selectedGender = document.getElementById('ddlGender').value == '0'
}

})

Name This is required
Password This is required
Gender this is required


This post first appeared on News About SEO, please read the originial post: here

Share the post

Form Validation throgh Angular js

×

Subscribe to News About Seo

Get updates delivered right to your inbox!

Thank you for your subscription

×