Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hey guys, I tweaked a small javascript that hides a div when the link is clicked then it opens it if clicked again. If I put text in the divs that open and close it appears fine but if i put an include file or even straight php the page stops loading at that div and does not display anything else, can you take a look at the code...
<script type="text/javascript">
<!--
function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != "none" ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}function hide(){
document.getElementById("employee_info").style.display='none';
document.getElementById("lead_list").style.display='none';
document.getElementById("client_lookup").style.display='none';
document.getElementById("job_list").style.display='none';
document.getElementById("message_box").style.display='none';
}
//-->
</script>
</head><body onload="hide();">
<div id="wrap">
<div id="header_wrap">
<div id="head_left"></div>
<div id="head_right"></div>
</div>
<div id="content">
<div id="employee_info_head"><a onclick="switchMenu('employee_info');">Employee Information</div>
<div id="employee_info"><?php include("includes/employee_change.php"); ?></div>
<div id="lead_list_head"><a onclick="switchMenu('lead_list');">Lead List</div>
<div id="lead_list"></div>
<div id="client_lookup_head"><a onclick="switchMenu('client_lookup');">Client Lookup</div>
<div id="client_lookup"></div>
<div id="job_list_head"><a onclick="switchMenu('job_list');">Job List</div>
<div id="job_list"></div>
<div id="message_box_head"><a onclick="switchMenu('message_box');">Message Box</div>
<div id="message_box"></div>
</div>
</div>basically, in the employee_info div would be information that should appear when someone clicks the employee_info_title link. If i out text in there its fine but if i put php it stops loading right there. Any ideas?

There's no reason that putting PHP code there would do anything - assuming it is valid code. Have you verified that the include file is correctly identified and works properly?
I do notice that you are not closing any of your anchor tags.
<div id="lead_list_head"><a onclick="switchMenu('lead_list');">Lead List</div>
That may not have anything to do with your problem, but it sure can't help.
I would double check that the include file works. You could also try just putting a simple PHP echo command in that div if you think it has anything to do with PHP code.
Michael J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |