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.Expand Bootstrap Accordion when valid data is entered in JavaScript<p>Hi <a class="username" rel="v@run">v@run</a>,</p> <p>Check the below code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <div class="demo_block"> <pre class="brush: html">&lt;div class=&#34;accordion&#34; id=&#34;dvAccordion&#34;&gt; &lt;div class=&#34;accordion-group&#34;&gt; &lt;div class=&#34;accordion-heading&#34;&gt; &lt;a class=&#34;accordion-toggle btn btn-primary&#34; data-toggle=&#34;collapse&#34; data-parent=&#34;#accordion2&#34; href=&#34;#collapseOne&#34;&gt;Item #1 &lt;/a&gt; &lt;/div&gt; &lt;div id=&#34;collapseOne&#34; class=&#34;accordion-body collapse in&#34;&gt; &lt;div class=&#34;accordion-inner&#34;&gt; &lt;p&gt; &lt;input id=&#34;txtName&#34; type=&#34;text&#34; onchange=&#34;return myFunction()&#34; /&gt;name&lt;/p&gt; &lt;p&gt; &lt;input id=&#34;txtPwd&#34; type=&#34;text&#34; onchange=&#34;return myFunction()&#34; /&gt;password&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&#34;accordion-group&#34;&gt; &lt;div class=&#34;accordion-heading&#34;&gt; &lt;a class=&#34;accordion-toggle btn btn-primary&#34; data-toggle=&#34;collapse&#34; data-parent=&#34;#accordion2&#34; href=&#34;#collapseTwo&#34;&gt;Item #2 &lt;/a&gt; &lt;/div&gt; &lt;div id=&#34;collapseTwo&#34; class=&#34;accordion-body collapse&#34;&gt; &lt;div class=&#34;accordion-inner&#34;&gt; &lt;p&gt; Some other text..&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; function myFunction() { var name = document.getElementById(&#39;txtName&#39;); var password = document.getElementById(&#39;txtPwd&#39;); var collapseOne = document.getElementById(&#39;collapseOne&#39;); var collapseTwo = document.getElementById(&#39;collapseTwo&#39;); if (name.value.length &gt; 0 &amp;&amp; password.value.length) { collapseOne.className = &#34;accordion-body collapse&#34;; collapseTwo.className = &#34;accordion-body collapse in&#34;; } else { collapseOne.className = &#34;accordion-body collapse in&#34;; collapseTwo.className = &#34;accordion-body collapse&#34;; } } &lt;/script&gt;</pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p>https://www.aspforums.net:443/Threads/991640/Expand-Bootstrap-Accordion-when-valid-data-is-entered-in-JavaScript/https://www.aspforums.net:443/Threads/991640/Expand-Bootstrap-Accordion-when-valid-data-is-entered-in-JavaScript/Thu, 25 Oct 2018 08:18:59 GMT