Javascript: How global variable can be used for comparision in body of HTML?

  • Thread starter Thread starter satarupa2511
  • Start date Start date
S

satarupa2511

Guest
How global variable can be used in body of xml using javascript?
like i am usnig drop down list box. the value chosen is stored in global variable. Now, I want to access this variable in the body of stylesheet. but variable losts its value in the body part. what to do? plz help.
Any javascript expert here....
Code here:
<Script>
function SwitchView()
{
if (document.getElementById)
{
var el = document.getElementById(obj);
if (el)
{
if ( el.style.display != "none" ) {
el.style.display = 'none';
document.getElementById("button1").inner... = "View BC Break";
}
else {
el.style.display = 'inline';
document.getElementById("button1").inner... = "Hide BC Break";
}
}
}
}
var issueType = document.drop_list.Issues.value;

---some code--------
</script>

<BODY bgColor="#f8f8f8" onload="fillCategory();">
<FORM name="drop_list">
<SELECT NAME="Issues" onChange="SelectSubCat();" >
<Option value="">Issue Type</Option>
</SELECT>
<SELECT NAME="Severity" onChange="displayrequiredDetails();" >
<Option value="">Severity</Option>
</SELECT>
<INPUT type="button" name="go" value="Go!" onClick="SwitchView();"> </INPUT>
</FORM>

---- Some code---------
Here I want to access "issueType" var for some conditional expression.
I tried. But no success.
----------------------------------

</BODY>

Can anyone help me or suggest me how can I access issueType here in the body part.
2 days ago - 5 days left to answer.
Additional Details
1 day ago

Hi Ikool Thanks for reply.

But adding an element like
<div id="myUpdateDiv">testing</div>
and filling the innerHTML of myUpdateDiv changes the text only.
My issue is how to use the variable issueType in body like:
One xmlDOMNode is used to display data.
here :
<xsl:if test="count(issue[status='NOK']) > 0 or count(issue[count(status) = 0 and bc_severity=issueType]) > 0">

Now this "issueType" does not work here. I want something like this, one global variable that's value is choosen by user using drop down list box will be used here for comparision.
 
Back
Top