Home All Groups Group Topic Archive Search About

Div tag to display/ hide a control ....please help

Author
29 Mar 2005 9:56 AM
~Maheshkumar.R
Hello groups,
i need small code snippet for implementaion of div tag. Let say, if i click
a button, i have to hide a checkbox list. I have placed that control inside
the Div tag, but not responding.

Mahes.




----------------------in codebehind --------------
Button1.Attributes.Add("onclick", "mycall()")

------------------------in aspx. page- -------------

<script language="javascript">
  function mycall()
  {
  alert("responding");
  var fr=document.Form1;
  fr.green.style.display="none";
  alert("yes disabled");
    }
  </script>
------------
<!--
   <DIV id="green" style="DISPLAY: block">
    <asp:checkboxlist id="CheckBoxList2" runat="server" Width="173px"
Height="41px" BackColor="Lime">
     <asp:ListItem Value="a">a</asp:ListItem>
     <asp:ListItem Value="b">b</asp:ListItem>
    </asp:checkboxlist>
   </DIV>
   <asp:button id="Button1" runat="server" Text="Button" Width="121px"
style="Z-INDEX: 101; LEFT: 147px; POSITION: absolute; TOP: 228px">
   </asp:button>
   -->

Author
29 Mar 2005 3:04 PM
nandha
Hi,
if you use server control it will post back..
please find the code below...

<script language="javascript">
        function show()
        {
           document.getElementById
('hideShow').style.visibility = 'visible'
        }
        function hide()
        {
           document.getElementById
('hideShow').style.visibility = 'hidden'
        }

        </script>


<form id="Form1" method="post" runat="server">
            <DIV id="hideShow">
                <asp:checkboxlist
id="CheckBoxList2" runat="server" Width="173px"
Height="41px" BackColor="Lime">
                    <asp:ListItem
Value="a">a</asp:ListItem>
                    <asp:ListItem
Value="b">b</asp:ListItem>
                </asp:checkboxlist>
            </DIV>

        </form>
        <input type=button value="show"
Width="121px" onclick="show()" >
        <input type=button value="hide"
Width="121px" onclick="hide()" >

Regards,
nandha.
>-----Original Message-----
>
>Hello groups,
>i need small code snippet for implementaion of div tag.
Let say, if i click
>a button, i have to hide a checkbox list. I have placed
that control inside
Show quoteHide quote
>the Div tag, but not responding.
>
>Mahes.
>
>
>
>
>----------------------in codebehind --------------
>Button1.Attributes.Add("onclick", "mycall()")
>
>------------------------in aspx. page- -------------
>
><script language="javascript">
>  function mycall()
>  {
>  alert("responding");
>  var fr=document.Form1;
>  fr.green.style.display="none";
>  alert("yes disabled");
>    }
>  </script>
>------------
><!--
>   <DIV id="green" style="DISPLAY: block">
>    <asp:checkboxlist id="CheckBoxList2" runat="server"
Width="173px"
>Height="41px" BackColor="Lime">
>     <asp:ListItem Value="a">a</asp:ListItem>
>     <asp:ListItem Value="b">b</asp:ListItem>
>    </asp:checkboxlist>
>   </DIV>
>   <asp:button id="Button1" runat="server" Text="Button"
Width="121px"
>style="Z-INDEX: 101; LEFT: 147px; POSITION: absolute;
TOP: 228px">
Show quoteHide quote
>   </asp:button>
>   -->
>
>
>.
>
Author
30 Mar 2005 6:22 AM
~Maheshkumar.R
Thnkz, i got somewhere the same code by google.
Maheshkr~

Show quoteHide quote
"nandha" <anonym***@discussions.microsoft.com> wrote in message
news:262801c53470$ac0b2440$a401280a@phx.gbl...
> Hi,
> if you use server control it will post back..
> please find the code below...
>
> <script language="javascript">
> function show()
> {
>    document.getElementById
> ('hideShow').style.visibility = 'visible'
> }
> function hide()
> {
>    document.getElementById
> ('hideShow').style.visibility = 'hidden'
> }
>
> </script>
>
>
> <form id="Form1" method="post" runat="server">
> <DIV id="hideShow">
> <asp:checkboxlist
> id="CheckBoxList2" runat="server" Width="173px"
> Height="41px" BackColor="Lime">
> <asp:ListItem
> Value="a">a</asp:ListItem>
> <asp:ListItem
> Value="b">b</asp:ListItem>
> </asp:checkboxlist>
> </DIV>
>
> </form>
> <input type=button value="show"
> Width="121px" onclick="show()" >
> <input type=button value="hide"
> Width="121px" onclick="hide()" >
>
> Regards,
> nandha.
> >-----Original Message-----
> >
> >Hello groups,
> >i need small code snippet for implementaion of div tag.
> Let say, if i click
> >a button, i have to hide a checkbox list. I have placed
> that control inside
> >the Div tag, but not responding.
> >
> >Mahes.
> >
> >
> >
> >
> >----------------------in codebehind --------------
> >Button1.Attributes.Add("onclick", "mycall()")
> >
> >------------------------in aspx. page- -------------
> >
> ><script language="javascript">
> >  function mycall()
> >  {
> >  alert("responding");
> >  var fr=document.Form1;
> >  fr.green.style.display="none";
> >  alert("yes disabled");
> >    }
> >  </script>
> >------------
> ><!--
> >   <DIV id="green" style="DISPLAY: block">
> >    <asp:checkboxlist id="CheckBoxList2" runat="server"
> Width="173px"
> >Height="41px" BackColor="Lime">
> >     <asp:ListItem Value="a">a</asp:ListItem>
> >     <asp:ListItem Value="b">b</asp:ListItem>
> >    </asp:checkboxlist>
> >   </DIV>
> >   <asp:button id="Button1" runat="server" Text="Button"
> Width="121px"
> >style="Z-INDEX: 101; LEFT: 147px; POSITION: absolute;
> TOP: 228px">
> >   </asp:button>
> >   -->
> >
> >
> >.
> >