igotstehsolution
asked on
radio button visible=true using javascript
Currently I have this tag:
<asp:CheckBox runat="server" Visible="false" ID="domain1nego" Text="I would like to consider negotiations with current owner." />
What javascript code would I need in order to make domain1nego.Visible="True"
I tried using:
<script language="javascript" type="text/javascript">
function showDomainNego1() {
document.getElementById('d omain1nego ').style.v isibility = 'visible';
return false;
}
</script>
but it didn't work.
Thanks ahead of time!!
<asp:CheckBox runat="server" Visible="false" ID="domain1nego" Text="I would like to consider negotiations with current owner." />
What javascript code would I need in order to make domain1nego.Visible="True"
I tried using:
<script language="javascript" type="text/javascript">
function showDomainNego1() {
document.getElementById('d
return false;
}
</script>
but it didn't work.
Thanks ahead of time!!
This one too :
<script language="javascript" type="text/javascript">
function showDomainNego1() {
document.getElementById('<%= domain1nego.ClientID %>').style.visibility = true;
return false;
}
</script>
ASKER
I tried both. Unfortunately neither worked.
Any other suggestions?
Any other suggestions?
Use :
because Visible="false" is interpreted on the server side and the checkbox is not in the page at the loading so you can't play with Javascript.
To display it, use : document.getElementById('d omain1nego ').setAttr ibute("dis play", "block");
because Visible="false" is interpreted on the server side and the checkbox is not in the page at the loading so you can't play with Javascript.
To display it, use : document.getElementById('d
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication13._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:CheckBox runat="server" display="hidden" ID="domain1nego" Text="I would like to consider negotiations with current owner." />
<script language="javascript" type="text/javascript">
document.getElementById('domain1nego').setAttribute("display", "block");
</script>
</form>
</body>
</html>
ASKER
<asp:CheckBox runat="server" display="hidden" ID="domain1nego" Text="I would like to consider negotiations with current owner." />
is still visible. so I tried style="display:none" and that made it invisible yet your setattribute script didn't work.
I tried making getElementById('<%= domain1nego.ClientID %>') aswell but that also didn't work.
is still visible. so I tried style="display:none" and that made it invisible yet your setattribute script didn't work.
I tried making getElementById('<%= domain1nego.ClientID %>') aswell but that also didn't work.
Sorry : display="none"
not : display="hidden"
ASKER
display="none" still doesn't work. the checkbox is visible.
sorry again the right one is: style="display:none"
<asp:CheckBox runat="server" style="display:none" ID="domain1nego" Text="I would like to consider negotiations with current owner." />
and :
document.getElementById('domain1nego').setAttribute("style", "display:block");
ASKER
Now its hidden but javascript isn't working to make it visible again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
works :)
tytyty
tytyty
Open in new window