Jump to content

[SOLVED] Issue with show and hide div's in IE 7 with checkbox


ainoy31

Recommended Posts

I have a checkbox that once clicked, it hides the current content data and displays the other content data.  If I click on the checkbox, the current content data disappears but the content I want does not display.  Also, if i click on the checkbox again, the checkbox itself disappears and the current content data re-appears.  This is only happening in IE7.  It works fine in FF and IE8.  Hope this makes sense. 

 

PHP Code:

<div id="nrai_check"><input type="checkbox" name="nrai" value="nrai_yes" onclick="showHideMe();"></div>

<div style="font-size: 12px; font-weight: normal; line-height: 13px; color: #000000; font-family: Helvetica, Arial, Verdana, sans-serif; margin:3px 0 0 0;">
  Message content goes here... ($120 for 1 year)
</div>

<div id="nrai" style="display:none; font-size: 12px; font-weight: bold; line-height: 13px; color: #000000; font-family: Helvetica, Arial, Verdana, sans-serif; margin:5px 0 0 22px;">Content Data.......</div>

<div id="regAgentInfo" style="display:block;">
Agent content....
</div>

 

javascript code:

function showHideMe()
{
var nrai = document.getElementById('nrai');
var agent = document.getElementById('regAgentInfo');
var agent_same = document.getElementById('regagent_same');

if(nrai.style.display=='block')
{
	nrai.style.display='none';
	agent.style.display='block';
	agent_same.disabled = false;
}
else
{
	nrai.style.display='block';
	agent.style.display='block';
	agent_same.disabled = true;
	agent_same.checked = false;
}
}

 

Please ignore the inline style. This is still in development stage.  Much appreciation.  AM

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.