jazjef
asked on
How do I get a horizontally oriented radiobuttonlist to make a dropdownlist visible or hidden using javascript?
My tools: Visual Web Developer, VB.net backcoding
This script works fine at the outset, but whenever I change the radiobuttonlist to 'horizontal' orientation within Visual Web Developer 'properties' the script does not work. If I change it back, then it still doesn't work. Can anyone give me a method to do this using a 'horizontally' oriented two-option radiobuttonlist rather than this vertical orientation?
Thanks.....
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Jscript_VB.NET_TOOL S</title>
<script language="javascript">
////////////////////////// ////////// ////////// ////////// /////////
//hide the dropdownlist on pageload...
function function_StartHidden()
{
document.getElementById("m yddl").sty le.display = "none";
}
window.onload= function_StartHidden;
//xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxx
</script>
<script type="text/javascript">
////////////////////////// ////////// ////////// ////////// //////////
//show the dropdownlist...
function ShowDropDown()
{
document.getElementById("m yddl").sty le.display = "inline";
}
////hide the dropdownlist
function HideDropDown()
{
document.getElementById("m yddl").sty le.display = "none";
}
//xxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx xxxxxxxxxx
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
Choose 'pn1' to make the dropdownlist visible; choose 'pn2' to hide the dropdownlist.....<br />
<br />
<asp:DropDownList ID="myddl" runat="server" Width="88px">
<asp:ListItem>item 1</asp:ListItem>
<asp:ListItem>item 2</asp:ListItem>
<asp:ListItem>item 3</asp:ListItem>
<asp:ListItem>item 4</asp:ListItem>
</asp:DropDownList> < br />
<br />
Here we have a radiobuttonlist:<br />
<asp:radiobuttonlist runat="Server" id="rbl">
<asp:listitem onclick="ShowDropDown()">p n1</asp:li stitem>
<asp:listitem onclick="HideDropDown()">p n2</asp:li stitem>
</asp:radiobuttonlist>
<br />
</div>
</form>
</body>
</html>
This script works fine at the outset, but whenever I change the radiobuttonlist to 'horizontal' orientation within Visual Web Developer 'properties' the script does not work. If I change it back, then it still doesn't work. Can anyone give me a method to do this using a 'horizontally' oriented two-option radiobuttonlist rather than this vertical orientation?
Thanks.....
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Jscript_VB.NET_TOOL
<script language="javascript">
//////////////////////////
//hide the dropdownlist on pageload...
function function_StartHidden()
{
document.getElementById("m
}
window.onload= function_StartHidden;
//xxxxxxxxxxxxxxxxxxxxxxxx
</script>
<script type="text/javascript">
//////////////////////////
//show the dropdownlist...
function ShowDropDown()
{
document.getElementById("m
}
////hide the dropdownlist
function HideDropDown()
{
document.getElementById("m
}
//xxxxxxxxxxxxxxxxxxxxxxxx
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
Choose 'pn1' to make the dropdownlist visible; choose 'pn2' to hide the dropdownlist.....<br />
<br />
<asp:DropDownList ID="myddl" runat="server" Width="88px">
<asp:ListItem>item 1</asp:ListItem>
<asp:ListItem>item 2</asp:ListItem>
<asp:ListItem>item 3</asp:ListItem>
<asp:ListItem>item 4</asp:ListItem>
</asp:DropDownList> <
<br />
Here we have a radiobuttonlist:<br />
<asp:radiobuttonlist runat="Server" id="rbl">
<asp:listitem onclick="ShowDropDown()">p
<asp:listitem onclick="HideDropDown()">p
</asp:radiobuttonlist>
<br />
</div>
</form>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.... that works great!
Can you explain to me why changing the radiobuttonlist orientation to 'horizontal' within the 'properties' section of the design area does not work, but adding RepeatDirection="Horizonta