Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS not unhiding asp.net control

Status
Not open for further replies.

mais123

Programmer
Dec 26, 2007
36
US
I have asp.net checkbox that I hide. There is another control that I attached onclick function that is supposed to unhide the checkbox. All is well and it seems that the function finds the checkbox OK but it stays hidden. No JS error is reported. What is wrong? Here is control

<td><asp:checkbox id="chkTelephoneDictation1" style= "display:none" runat="server" Width="240px"></asp:checkbox></td>

Here is JS to unhide
function Unhide()
{
var dictation = document.getElementById('chkTelephoneDictation1');
dictation.style.display = "block";

//also tried dictation.style.display = "";
 
What does the client-side representation look like? That's where the code is attempting to be executed.

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Webflo
 
This is how it looks on client
<td><span style="display:inline-block;width:240px;display:none"><input id="chkTelephoneDictation1" type="checkbox" name="chkTelephoneDictation1" /></span></td>
 
You have a contradiction in your style:
Code:
style="display:inline-block;width:240px;display:none"

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top