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.Auto focus to next TextBox when MaxLength reached in JavaScript<p>Hi <a class="username" rel="Alauddin"> Alauddin</a>,</p> <p>Refer below modified code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;asp:TextBox ID=&#34;second&#34; runat=&#34;server&#34; size=&#34;4&#34; MaxLength=&#34;4&#34; onkeypress=&#34;input_onchange(this)&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox TextMode=&#34;Password&#34; ID=&#34;third&#34; runat=&#34;server&#34; size=&#34;6&#34; MaxLength=&#34;6&#34; onkeypress=&#34;input_onchange(this)&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:TextBox ID=&#34;fourth&#34; runat=&#34;server&#34; size=&#34;6&#34; MaxLength=&#34;6&#34;&gt;&lt;/asp:TextBox&gt; &lt;script type=&#34;text/javascript&#34;&gt; function input_onchange(me) { if (me.value.length &lt;= me.getAttribute(&#39;maxlength&#39;) - 1) { return; } var i; var elements = me.form.elements; for (i = 0, numElements = elements.length; i &lt; numElements; i++) { if (elements[i] == me) { break; } } elements[i + 1].focus(); } &lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong>IE</strong></p> <p><img src="https://imgur.com/lNaX6eE.gif" alt="" width="249" height="105" /></p> <p><strong>Chrome and Mozilla</strong></p> <p><img src="https://imgur.com/P6VZhDo.gif" alt="" width="472" height="127" /></p>https://www.aspforums.net:443/Threads/112690/Auto-focus-to-next-TextBox-when-MaxLength-reached-in-JavaScript/https://www.aspforums.net:443/Threads/112690/Auto-focus-to-next-TextBox-when-MaxLength-reached-in-JavaScript/Mon, 15 Oct 2018 01:01:51 GMT