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 entered Month should not be less than specific month from Current Date in JavaScript<p>Hey</p> <p>Please refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34;&gt; function ValidateDOB(sender, args) { var dateString = document.getElementById(sender.controltovalidate).value; var regex = /(((0|1)[0-9]|2[0-9]|3[0-1])\/(0[1-9]|1[0-2])\/((19|20)\d\d))$/; if (regex.test(dateString)) { var parts = dateString.split(&#34;/&#34;); var dt = new Date(parts[1] + &#34;/&#34; + parts[0] + &#34;/&#34; + parts[2]); var dtCurrent = new Date(); if (dt.getYear() == dtCurrent.getYear()) { if (dt.getMonth() &gt; dtCurrent.getMonth() - 6) { alert(&#39;month should not be less than 6 months.&#39;); } } args.IsValid = true; } else { sender.innerHTML = &#34;Enter date in dd/MM/yyyy format ONLY.&#34; args.IsValid = false; } } &lt;/script&gt; &lt;div&gt; &lt;asp:CustomValidator ID=&#34;CustomValidator2&#34; runat=&#34;server&#34; ClientValidationFunction=&#34;ValidateDOB&#34; ControlToValidate=&#34;TextBox16&#34; ErrorMessage=&#34;&#34; ForeColor=&#34;Red&#34; /&gt; &lt;asp:TextBox ID=&#34;TextBox16&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;/div&gt;</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://imgur.com/1s2NBlu.gif" alt="" width="317" height="263" /></p>https://www.aspforums.net:443/Threads/924765/Validate-entered-Month-should-not-be-less-than-specific-month-from-Current-Date-in-JavaScript/https://www.aspforums.net:443/Threads/924765/Validate-entered-Month-should-not-be-less-than-specific-month-from-Current-Date-in-JavaScript/Fri, 23 Nov 2018 00:11:40 GMT