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.Check Uncheck and disable CheckBox based on another in jQuery<p>Hi <a class="username" rel="nauna"> nauna</a>,</p> <p>Check this example. Now please take its reference and correct your code.</p> <div class="demo_block"><strong><span style="text-decoration: underline;">HTML</span></strong> <pre class="brush: html">&lt;label class=&#34;switch pull-right&#34;&gt; &lt;input type=&#34;checkbox&#34; id=&#34;chkPassport&#34; class=&#34;Passport&#34; /&gt; &lt;span class=&#34;slider round&#34;&gt;&lt;/span&gt; &lt;/label&gt; &lt;label class=&#34;switch pull-right&#34;&gt; &lt;input type=&#34;checkbox&#34; id=&#34;chkPassport1&#34; class=&#34;Passport&#34; /&gt; &lt;span class=&#34;slider round&#34;&gt;&lt;/span&gt; &lt;/label&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $(&#39;.Passport&#39;).on(&#39;change&#39;, function () { var chk1 = $(&#39;[id$=chkPassport]&#39;); var chk2 = $(&#39;[id$=chkPassport1]&#39;); var id = $(this).attr(&#39;id&#39;); if ($(chk1).attr(&#39;id&#39;) == id) { if ($(chk1).is(&#39;:checked&#39;)) { $(chk1).closest(&#39;label&#39;).find(&#39;span&#39;).html(&#39;true&#39;); $(chk2).closest(&#39;label&#39;).find(&#39;span&#39;).html(&#39;false&#39;); $(chk2).attr(&#34;checked&#34;, false); $(chk2).attr(&#34;disabled&#34;, true); } else { $(chk2).attr(&#34;disabled&#34;, false); $(chk1).closest(&#39;label&#39;).find(&#39;span&#39;).html(&#39;false&#39;); } } else { $(chk2).closest(&#39;label&#39;).find(&#39;span&#39;).html($(chk2).is(&#39;:checked&#39;) ? &#39;true&#39; : &#39;false&#39;); } }); }); &lt;/script&gt;</pre> </div> <p><a class="demo button orange btn btn-red">Demo</a></p>https://www.aspforums.net:443/Threads/560181/Check-Uncheck-and-disable-CheckBox-based-on-another-in-jQuery/https://www.aspforums.net:443/Threads/560181/Check-Uncheck-and-disable-CheckBox-based-on-another-in-jQuery/Thu, 11 Oct 2018 04:25:59 GMT