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 validation using regular expression in jQuery<div class="demo_block">Hi <a class="username" rel="power"> power</a>,</div> <div class="demo_block">&nbsp;</div> <div class="demo_block">Refer the below code.</div> <div class="demo_block"> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;div&gt; &lt;script type=&#34;text/javascript&#34;&gt; function PasswordValidator() { var passwordstrength = document.getElementById(&#34;&lt;%=txtPassword.ClientID%&gt;&#34;); 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(passwordstrength.value)) { passed++; } } if (passed &gt; 3) { alert(&#34;Valid&#34;); } else { alert(&#34;Password must contain at least 1 capital letter,\n\n1 small letter, 1 number and 1 special character.\n\nFor special characters you can pick one of these -,(,!,@,#,$,),%,&lt;,&gt;&#34;); return false; } } &lt;/script&gt; &lt;input name=&#34;txtPassword&#34; type=&#34;password&#34; id=&#34;txtPassword&#34; /&gt; &lt;input type=&#34;submit&#34; name=&#34;btnCheck&#34; value=&#34;Check&#34; onclick=&#34;PasswordValidator();&#34; id=&#34;btnCheck&#34; style=&#34;position: absolute; width: 90px;&#34; /&gt; &lt;/div&gt; &lt;/form&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/103764/Password-validation-using-regular-expression-in-jQuery/https://www.aspforums.net:443/Threads/103764/Password-validation-using-regular-expression-in-jQuery/Mon, 07 Nov 2016 09:27:47 GMT