Computing.Net > Forums > Web Development > php wont work in hidden div

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

php wont work in hidden div

Reply to Message Icon

Name: BigShow
Date: May 13, 2008 at 22:58:56 Pacific
OS: xp pro
CPU/Ram: pentium
Product: dell
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: May 13, 2008 at 23:34:01 Pacific
Reply:

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


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: php wont work in hidden div

drop down wont work in firefox www.computing.net/answers/webdevel/drop-down-wont-work-in-firefox/3581.html

code works in Firefox but not in IE www.computing.net/answers/webdevel/code-works-in-firefox-but-not-in-ie/2252.html

Website wont work with the www.computing.net/answers/webdevel/website-wont-work-with-the-/182.html