how to display panel using javascript?

Posted by Hariinakoti under JavaScript on 10/12/2012 | Points: 10 | Views : 3189 | Status : [Member] | Replies : 2
Hi All.
I want to display Panel when i clicked on radio button list item. I wrote code like this .and i called this function in radibuttonlist onclick.I hide panel in another function.
function displaypanel()
{

var pnltlmapobj=document.getElementById('<%=rbtntlmapyn.ClientID%>');
var pnltlmap= pnltlmapobj.getElementsByTagName('input');

if(pnltlmap.item(0).checked==true)
{
document.getElementByID('pnltlmapping').style.display = 'block';

}

}

Thanks & Regards
Hari



Responses

Posted by: Sureshknkt7 on: 10/12/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can do this by using Jquery,


Aspx code:

<div>

<asp:RadioButtonList ID="Radiobutton" runat="server">
<asp:ListItem Text="Male"></asp:ListItem>
<asp:ListItem Text="Female"></asp:ListItem>
</asp:RadioButtonList>
<div id="dv" style="display:none;">
<asp:Panel ID="panel1" runat="server">
<asp:TextBox ID="tex" runat="server"></asp:TextBox>
</asp:Panel>
</div>
</div>



Jquery :

Add jquery plugin

<script type="text/javascript">

$(function () {
$('#<%=Radiobutton.ClientID %>').click(function () {
$('#dv').toggle(function () {
$('#panel1').show();

});

});
});
</script>


Regards,
Suresh K


Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hariinakoti on: 10/12/2012 [Member] Starter | Points: 25

Up
0
Down
Thanq Suresh i got it in JavaScript.

Thanks & Regards
Hari

Hariinakoti, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response