Hi,
I have one field Date
currently my requirement is that based upon date i need to get Age
after that based upon condition need to display alert message
could you please help me
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Index</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.8/angular.min.js"></script>
<script type="text/javascript">
var app = angular.module('MyApp', [])
app.controller('MyController', function ($scope, $http) {
$scope.Save=function(){
if($scope.Age<18 && $scope.Age>60){
alert("Success");
}
else{
alert("Failed");
}
}
})
</script>
</head>
<body>
<div ng-app="MyApp" ng-controller="MyController">
Date:<input type="date" ng-model="RefNo" /><br />
Age:<input type="hidden" ng-model="Age" />
<br /><button type="button" ng-click="Save()">Save</button>
</div>
</body>
</html>