Hi all,
I have the following:
[code]
<script language=”javascript”>
<!–
function swapIt(chk) {
if(chk.value == “S”) document.getElementById(‘theRow’).style.visibility=”visible”;
document.getElementById(‘status’)=”StatusBar”;
else {
document.getElementById(‘theRow’).style.visibility=”hidden”;
}
if(chk.value == “E”) document.getElementById(‘theRow_2’).style.visibility=”visible”;
document.getElementById(‘status’)=”StatusBar_2″;
else {
document.getElementById(‘theRow_2’).style.visibility=”hidden”;
}
}
// –>
</script>
<DIV id=StatusBarContainer>
<DIV id=status>
<DIV id=”theRow_2″ style=”visibility:hidden”>
<table width=”100%” bgcolor=”#0000CC” cellpadding=”0″ cellspacing=”0″>
<tr><td>
<a href=”#” name=”ship_method” value=”S” onClick=”swapIt(this);”>Cancel</a>
</td></tr>
</table>
</DIV>
<DIV id=”theRow” style=”visibility:visible”>
<DIV id=StatusLeft>cartGURUS Administration – pmGURU (<a href=”admin/” >Dashboard</a> | <a href=”#” value=”E” onClick=”swapIt(this);”>Switch Projects</a>) </DIV>
<DIV id=StatusRight>
Logged in as
<?
include (“include/dbconnect.php”);
$cSQL = mysql_query(“SELECT first_name,last_name FROM admin WHERE admin_id = ‘” . $_SESSION[‘valid_admin’] . “‘”);
while ($row = mysql_fetch_array($cSQL)) {
echo $row[‘first_name’] . ” ” . $row[‘last_name’];
}
?>
(<A
title=”Log-out and clear the cookie off your machine”
href=”login.php”>Log-out</A>)
</DIV></DIV></DIV></DIV>
All is working fine except when i try and pass the
[code]
document.getElementById(‘status’)=”StatusBar”;
to the <DIV id=”status”> it doesn’t pass the value StatusBar or StatusBar_2 (depending on the condition).
Can anyone see where i am going wrong.
I don’t think this is written correctly
[code]
document.getElementById(‘status’)=”StatusBar”;
Cheers,
camcim