Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6789157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:34:12+00:00 2026-05-26T17:34:12+00:00

I have a situation where i have to show/Hide DIV TAG based on Checkbox

  • 0

I have a situation where i have to show/Hide DIV TAG based on Checkbox selection. Below is the code example

<asp:RadioButtonList ID="ckbRestaurent" runat="server"  RepeatDirection="Horizontal" RepeatLayout="Flow" >   
     <asp:ListItem selected="true" Value="0">No</asp:ListItem>  
     <asp:ListItem Value="1">Yes</asp:ListItem> 
</asp:RadioButtonList>

<div id="xyz"> something.. </div>

I tried several ways but it didn’t work as i am new to jQuery, I would appreciate if someone would give me a working example for the above code .

It should by default hide div on page load and show DIV when user select the YES option in the RadioButtonList

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:34:13+00:00Added an answer on May 26, 2026 at 5:34 pm

    Since i wanted solution using the exact HTML show in my question. SO i found a solution which is as

    <script language="javascript" type="text/javascript">
       $(document).ready(function () {
         $('#RadioDiv input').click(function () {
         $("#info").text('Selected Value: ' + $("#RadioDiv input:radio:checked").val());
             if ($("#RadioDiv input:radio:checked").val() == 0) {
                  document.getElementById('Restaurent').style.display = "none";
                  }
                  else {
                  document.getElementById('Restaurent').style.display = "";
                        }
           });
         }); 
    </script>
    

    HTML CODE BELOW

    <div id="RadioDiv">
    <asp:RadioButtonList ID="ckbRestaurent" runat="server"  RepeatDirection="Horizontal" RepeatLayout="Flow" >   
      <asp:ListItem selected="true" Value="0">No</asp:ListItem>  
      <asp:ListItem Value="1">Yes</asp:ListItem> 
    </asp:RadioButtonList>
    </div>
    <table class="style1">
          <tr>
             <td ></td><td></td>
          </tr>
          <tr><td ></td><td></td>
           </tr>
    </table>
        </br>
    <div id="Restaurent" style="display:none" >
    <!-- Details Group Restaurent Table -->
    <table cellpadding="0" cellspacing="0" class="tableDetailsGroupOne">
      <tr>
          <td class="tableDetailsGroupOneLabel">Restaurant One:</td>
          <td>
          <asp:TextBox ID="txtRestaurentOne" runat="server" CssClass="txtNameOfHotel">Restaurent One</asp:TextBox>
          </td>
    </tr>
    <tr>
          <td class="tableDetailsGroupOneLabel">Restaurent Two:</td>
          <td>
    <asp:TextBox ID="txtRestaurentTwo" runat="server" CssClass="txtNameOfHotel" ></asp:TextBox>
          </td>
    </tr>
    </table>
    </div>
    <!-- Details Group Restaurent Table END-->
    

    I also appreciate other user who also replied to my question, since i wanted solution using for ASP.NET server control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation in which user can single tap a control, which show
I have the following situation I think would be best to show in sample
I have situation where I generate stylesheets based on information in the database. This
Often I have a situation when I meed to show whole picture but clarify
I have this situation where I have some pictures: http://www.example.com/test1.jpg http://www.example.com/test2.jpg http://www.example.com/test3.jpg .... some
Situation: I have a check box and a div container inside another div container.
I have a situation that i have a hidden div with two input elements
I have this situation: I made 2 div's, both should be at the exact
I've recently come across the following situation. I have a UserControl that can show
I have a situation here: I have a page which is using to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.