ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Password Strength validation using JavaScript in AngularJS<p>Hi&nbsp;rani,</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <div class="demo_block"> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.8/angular.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; var app = angular.module(&#39;MyApp&#39;, []); app.controller(&#39;MyController&#39;, function ($scope) { $scope.Validate = function () { var password = $scope.Password; //Regular Expressions. var regex = new Array(); regex.push(&#34;[A-Z]&#34;); //Uppercase Alphabet. regex.push(&#34;[a-z]&#34;); //Lowercase Alphabet. regex.push(&#34;[0-9]&#34;); //Digit. regex.push(&#34;[$@$!%*#?&amp;]&#34;); //Special Character. var passed = 0; for (var i = 0; i &lt; regex.length; i++) { if (new RegExp(regex[i]).test(password)) { passed++; } } if (passed &gt; 2 &amp;&amp; password.length &gt; 8) { passed++; } switch (passed) { case 0: case 1: $scope.Style = { &#34;height&#34;: &#34;10px&#34;, &#34;background-color&#34;: &#34;red&#34; }; break; case 2: $scope.Style = { &#34;height&#34;: &#34;10px&#34;, &#34;background-color&#34;: &#34;darkorange&#34; }; break; case 3: case 4: $scope.Style = { &#34;height&#34;: &#34;10px&#34;, &#34;background-color&#34;: &#34;green&#34; }; break; case 5: $scope.Style = { &#34;height&#34;: &#34;10px&#34;, &#34;background-color&#34;: &#34;darkgreen&#34; }; break; } } }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div ng-app=&#34;MyApp&#34; ng-controller=&#34;MyController&#34;&gt; &lt;input type=&#34;password&#34; name=&#34;Password&#34; ng-model=&#34;Password&#34; ng-keyup=&#34;Validate()&#34; /&gt; &lt;br /&gt;&lt;div ng-style=&#34;Style&#34; ng-show=&#34;Password&#34;&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p>https://www.aspforums.net:443/Threads/131552/Password-Strength-validation-using-JavaScript-in-AngularJS/https://www.aspforums.net:443/Threads/131552/Password-Strength-validation-using-JavaScript-in-AngularJS/Fri, 12 Jul 2019 04:12:06 GMT