MuttleyDiXiE
MIS
I have been trying for the last couple of days to make this script execute in the "body" of my webpage. The script looks like this in the "head" section.
<script language="JavaScript1.2">
<!--
var ns6=document.getElementById&&!document.all?1:0
var head="display:''"
var folder=''
function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none"
folder.display=""
else
folder.display="none"
}
function expanditallready(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style;
folder.display="";
}
//-->
</script>
This is what I have in the "body" section.
<cfif #Client.ExpIkkeStartet# EQ "yes">
<h1 class="titleexpander" style="cursorointer; cursor:hand" onClick="expandit(this)">IKKE STARTET</h1>
<cfelseif #Client.ExpIkkeStartet# EQ "no">
<h1 class="titleexpander" style="cursorointer; cursor:hand"><script type="text/javascript">expanditallready(this)</script>IKKE STARTET</h1>
</cfif>
The "onClick" works fine but it is the <cfelseif> clause that's giving me trouble. I want the script to execute if the <cfelseif> clause validates to true but it does not execute upon validating to true! I don't know anything about javascripting so I'm really lost here. I don't know if it's the way I'm trying to execute the script in my <cfelseif> clause or if something in the script needs to be changed in order for it to work. Any help will be greatly appreciated.
/DiXiE
<script language="JavaScript1.2">
<!--
var ns6=document.getElementById&&!document.all?1:0
var head="display:''"
var folder=''
function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none"
folder.display=""
else
folder.display="none"
}
function expanditallready(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style;
folder.display="";
}
//-->
</script>
This is what I have in the "body" section.
<cfif #Client.ExpIkkeStartet# EQ "yes">
<h1 class="titleexpander" style="cursorointer; cursor:hand" onClick="expandit(this)">IKKE STARTET</h1>
<cfelseif #Client.ExpIkkeStartet# EQ "no">
<h1 class="titleexpander" style="cursorointer; cursor:hand"><script type="text/javascript">expanditallready(this)</script>IKKE STARTET</h1>
</cfif>
The "onClick" works fine but it is the <cfelseif> clause that's giving me trouble. I want the script to execute if the <cfelseif> clause validates to true but it does not execute upon validating to true! I don't know anything about javascripting so I'm really lost here. I don't know if it's the way I'm trying to execute the script in my <cfelseif> clause or if something in the script needs to be changed in order for it to work. Any help will be greatly appreciated.
/DiXiE