Hi,
Can anyone suggest why this isn't working in FF?
function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
if (id != 'title_div') { title_div.style.display = "none"; }
if (id != 'subheader_div') { subheader_div.style.display = "none"; }
if (id != 'lead_div') { lead_div.style.display = "none"; }
if (id != 'video_div') { video_div.style.display = "none"; }
if (id != 'testimonials_div') { testimonials_div.style.display = "none"; }
if (id != 'header_div') { header_div.style.display = "none"; }
}
}
</script>
Basically, it all works - appart from the last few lines.
..gives:
Source File: http://www.site.com/cgi-bin/add_more_info.cgi?ID=18
Line: 71
Guessing I'm using the wrong format with this bit:
...any suggestions? (I've had a look on google, but couldn't find anything helpful :/)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Can anyone suggest why this isn't working in FF?
Code:
<script> function showhide(id){
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "none";
}
if (id != 'title_div') { title_div.style.display = "none"; }
if (id != 'subheader_div') { subheader_div.style.display = "none"; }
if (id != 'lead_div') { lead_div.style.display = "none"; }
if (id != 'video_div') { video_div.style.display = "none"; }
if (id != 'testimonials_div') { testimonials_div.style.display = "none"; }
if (id != 'header_div') { header_div.style.display = "none"; }
}
}
</script>
Basically, it all works - appart from the last few lines.
Code:
if (id != 'title_div') { title_div.style.display = "none"; }..gives:
Quote:
Error: title_div is not defined Source File: http://www.site.com/cgi-bin/add_more_info.cgi?ID=18
Line: 71
Guessing I'm using the wrong format with this bit:
Code:
title_div.style.display...any suggestions? (I've had a look on google, but couldn't find anything helpful :/)
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!