K
Kevin
My HTML has 2 javascript functions. The first function, showReport,
simply reads an XML file and populates a table. The second function,
selectTab, allows for different data to be shown based on which button
is pressed. For example, there may be 2 buttons- Executive and
Technical. If you press the "Executive" button, then you'll only see a
view geared towards executives, whereas Technical shows technical
features.
The buttons' onClick functions make use of "selectTab," however I
constantly get an error, " selectTab not defined" whenever I press the
button in my web browser.
Please take a look at it (I have many times) and let me know if you
see any errors.
function selectTab(x)
{
if(x == "ps")
{
document.getElementById("project_summary").style.visibility =
"visible";
document.getElementById("proposal_information").style.visibility =
"hidden";
document.getElementById("cs_criteria").style.visibility =
"hidden";
document.getElementById("project_summary").style.display = "";
document.getElementById("proposal_information").style.display =
"none";
document.getElementById("cs_criteria").style.display = "none";
return;
}
else if(x == "pi")
{
document.getElementById("project_summary").style.visibility =
"hidden";
document.getElementById("proposal_information").style.visibility =
"visible";
document.getElementById("cs_criteria").style.visibility =
"hidden";
document.getElementById("project_summary").style.display = "none";
document.getElementById("proposal_information").style.display =
"";
document.getElementById("cs_criteria").style.display = "none";
return;
}
else if(x == "csc")
{
document.getElementById("project_summary").style.visibility =
"hidden";
document.getElementById("proposal_information").style.visibility =
"hidden";
document.getElementById("cs_criteria").style.visibility =
"visible";
document.getElementById("project_summary").style.display = "none";
document.getElementById("proposal_information").style.display =
"none";
document.getElementById("cs_criteria").style.display = "";
return;
}
else
{
alert ("error");
return;
}
}
simply reads an XML file and populates a table. The second function,
selectTab, allows for different data to be shown based on which button
is pressed. For example, there may be 2 buttons- Executive and
Technical. If you press the "Executive" button, then you'll only see a
view geared towards executives, whereas Technical shows technical
features.
The buttons' onClick functions make use of "selectTab," however I
constantly get an error, " selectTab not defined" whenever I press the
button in my web browser.
Please take a look at it (I have many times) and let me know if you
see any errors.
function selectTab(x)
{
if(x == "ps")
{
document.getElementById("project_summary").style.visibility =
"visible";
document.getElementById("proposal_information").style.visibility =
"hidden";
document.getElementById("cs_criteria").style.visibility =
"hidden";
document.getElementById("project_summary").style.display = "";
document.getElementById("proposal_information").style.display =
"none";
document.getElementById("cs_criteria").style.display = "none";
return;
}
else if(x == "pi")
{
document.getElementById("project_summary").style.visibility =
"hidden";
document.getElementById("proposal_information").style.visibility =
"visible";
document.getElementById("cs_criteria").style.visibility =
"hidden";
document.getElementById("project_summary").style.display = "none";
document.getElementById("proposal_information").style.display =
"";
document.getElementById("cs_criteria").style.display = "none";
return;
}
else if(x == "csc")
{
document.getElementById("project_summary").style.visibility =
"hidden";
document.getElementById("proposal_information").style.visibility =
"hidden";
document.getElementById("cs_criteria").style.visibility =
"visible";
document.getElementById("project_summary").style.display = "none";
document.getElementById("proposal_information").style.display =
"none";
document.getElementById("cs_criteria").style.display = "";
return;
}
else
{
alert ("error");
return;
}
}