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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.