I'm trying to make it so when user goes to dashboard.php?option=home, they are presented with only support_ticket_div, while when they go to dashboard.php?option=ucp, they are presented only with control_panel_div. For some reason, the DIVs won't hide when I click on the buttons with those links from above. Instead, both of the DIVs show, one under another. This is my PHP code that is placed before the DIVs:
<?php
if($_GET['option'] == 'home') { ?>
<script type="text/javascript">setcontent(1);</script> <?
}
if($_GET['option'] == 'ucp') { ?>
<script type="text/javascript">setcontent(2);</script> <?
}
?>
This is my setcontent() javascript function located in the tags in the head section
function setcontent(id)
{
switch(id)
{
case 1:
document.getElementById('control_panel_div').style.display = 'none';
document.getElementById('support_ticket_div').style.display = 'inline';
break;
case 2:
document.getElementById('support_ticket_div').style.display = 'none';
document.getElementById('control_panel_div').style.display = 'inline';
break;
}
}
Can anyone help me out? Thanks...