I have a php script that pulls off details of employees and displays them in a table. I applied a javascript function which is supposed to let the user click on a name and make the hidden table for that person visible.
I keep getting the error “reveal is not defined”?
Why?
Below is the script:
[B][I
function reveal(el)
{
if(document.getElementById(el).style.display = ‘none’)
{
document.getElementById(el).style.display = ‘block’;
}
else
{
document.getElementById(el).style.display = ‘none’;
}
}
[B][I]salesMatrix.php
Top line = “<script language=”text/javascript” src=”JavascriptClasses/ajaxClass.js”></script>”
the bottom of the file in which the js function is called:
$arrMatrices = $objDV->getMatrices();
foreach($arrMatrices as $arrMatrix)
{
$strName = $arrMatrix[‘name’];
$intMatrixID = $arrMatrix[‘intUserID’];
$arrMatrixDets = $objDV->getMatrixDets($intMatrixID);
print “<tr><td><a href=”#” onClick=”reveal(‘” . $intMatrixID . ‘”);”>$strName<a/></td></tr>”;
print “</table>”;
foreach($arrMatrixDets as $arrMatrixDet)
{
print “<table border=1 id=’$intMatrixID’ style=”display:none;”>”;
$dtmAdded = $arrMatrixDet[‘dtmAdded’];
$strReference = $arrMatrixDet[‘intAdvancesID’];
$strReviewer = $arrMatrixDet[‘reviewer’];
print “<tr><td>$dtmAdded</td><td>$strReference</td><td>$strReviewer</td></tr>”;
}
print “</table>”;
}
print “</div>”;