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.Validate Passport number in JavaScript<p>Hi <a class="username" rel="PRA"> PRA</a>,</p> <p>Please refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <div class="demo_block"> <pre class="brush: html">Passport: &lt;input name=&#34;txtPassport&#34; type=&#34;text&#34; id=&#34;txtPassport&#34; maxlength=&#34;8&#34; /&gt; &lt;input type=&#34;submit&#34; value=&#34;Submit&#34; onclick=&#34;return Check();&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; function Check() { var patt = new RegExp(&#34;^([A-Z a-z]){1}([0-9]){7}$&#34;) var advalue = document.getElementById(&#34;txtPassport&#34;).value; if (patt.test(advalue)) { return true; } else { alert(&#34;Passport is not valid&#34;); } return false; } &lt;/script&gt;</pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p>https://www.aspforums.net:443/Threads/116993/Validate-Passport-number-in-JavaScript/https://www.aspforums.net:443/Threads/116993/Validate-Passport-number-in-JavaScript/Tue, 16 Oct 2018 04:48:09 GMT