CODEDIGEST InstallShield
Home Articles CodeDigest Tutorials InstallShield FAQs
Skip Navigation LinksHome » CodeDigest » Show and Hide DIV tag based on Checkbox selection using JQuery   You are not logged in.
Search
 

Sponsors
InstallShield
 

Sponsored Links
 

Technologies
 

CodeDigest Navigation
 

Technology News
No News Feeds available at this time.
 

Community News
No News Feeds available at this time.
 
Show and Hide DIV tag based on Checkbox selection using JQuery
Show and Hide DIV tag based on Checkbox selection using JQuery
Submitted By Satheesh Babu
On 12/12/2008 6:55:16 AM
Tags: CodeDigest,Jquery  

Show and Hide DIV tag based on Checkbox selection using JQuery

 

There are situations where we need to show and hide div tag based on some conditions in client side.

The following code snippet will help us to hide and show a div tag based on checkbox selection using Jquery.

 

<script language="javascript">

          function EnableDisableDIV() {

              if ($("#chkShowPersonal").attr("checked")) {

                  $("#dvPersonal").show();

              } else {

              $("#dvPersonal").hide();

              }             

          }         

      </script>

 

 <asp:CheckBox ID="chkShowPersonal"  onclick="EnableDisableDIV()" runat="server" />

        <div id="dvPersonal" style="display:none">

            <asp:TextBox ID="txtName" runat="server"></asp:TextBox>

        </div>

Do you have a working code that can be used by anyone? Submit it here. It may help someone in the community!!