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 multiple TextBoxes on Button Click using JavaScript in ASP.Net<p>Hi <a class="username" rel="chetan">chetan</a>,</p> <p>Refer the below code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;div class=&#34;header-search-form&#34;&gt; &lt;div class=&#34;header-form-container&#34;&gt; &lt;div class=&#34;header-input-container&#34;&gt; &lt;span class=&#34;header-input-title&#34;&gt;Keyword:&lt;/span&gt; &lt;input type=&#34;text&#34; id=&#34;txtkeyword&#34; name=&#34;s&#34; runat=&#34;server&#34; autocomplete=&#34;off&#34;&gt; &lt;div class=&#34;clearfix&#34;&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&#34;header-input-container&#34;&gt; &lt;span class=&#34;header-input-title&#34;&gt;Category:&lt;/span&gt; &lt;input type=&#34;text&#34; id=&#34;txtserach&#34; list=&#34;browsers&#34; name=&#34;myBrowser&#34; runat=&#34;server&#34; autocomplete=&#34;off&#34; /&gt; &lt;datalist id=&#34;browsers&#34;&gt; &lt;option value=&#34;Automotive&#34;/&gt; &lt;option value=&#34;Building and Interiors&#34;/&gt; &lt;option value=&#34;Food, Kitchen and Hotel Supplies&#34;/&gt; &lt;option value=&#34;Industrial and Machinery&#34;/&gt; &lt;option value=&#34;Consumer and Household&#34;/&gt; &lt;option value=&#34;Medical and Healthcare&#34;/&gt; &lt;option value=&#34;Printing , Packaging and Plastic&#34;/&gt; &lt;option value=&#34;IT / Telecom / Electronics&#34;/&gt; &lt;option value=&#34;Oil and Gas&#34;/&gt; &lt;option value=&#34;Power and Energy&#34;/&gt; &lt;/datalist&gt; &lt;div class=&#34;clearfix&#34;&gt; &lt;/div&gt; &lt;/div&gt; &lt;asp:Button ID=&#34;Search&#34; Text=&#34;Search&#34; runat=&#34;server&#34; OnClick=&#34;doit&#34; OnClientClick=&#34;return checkLength();&#34; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;script type=&#34;text/javascript&#34;&gt; function checkLength() { var txtKeyWord = document.getElementById(&#39;&lt;%=txtkeyword.ClientID%&gt;&#39;); var txtCategory = document.getElementById(&#39;&lt;%=txtserach.ClientID%&gt;&#39;); if (txtKeyWord.value.length &lt; 3 &amp;&amp; txtCategory.value.length == 0) { alert(&#34;The entered input should be 3 or more than 3 characters&#34;); return false; } } &lt;/script&gt;</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><img src="https://imgur.com/kQfEDyr.gif" alt="" width="388" height="262" /></p>https://www.aspforums.net:443/Threads/564761/Validate-multiple-TextBoxes-on-Button-Click-using-JavaScript-in-ASPNet/https://www.aspforums.net:443/Threads/564761/Validate-multiple-TextBoxes-on-Button-Click-using-JavaScript-in-ASPNet/Wed, 10 Oct 2018 05:03:51 GMT