Browser compatabilty issue
Hi guys,
I have the following code that works fine in IE but not in Firefox/NN.
Can anyone see what is causing this?
Code:
<script language="javascript">
<!--
function swapIt(chk) {
if(chk.value == "S") document.getElementById('theRow').style.display="inline";
else {
document.getElementById('theRow').style.display="none";
}
if(chk.value == "E") document.getElementById('theRow_2').style.display="inline";
else {
document.getElementById('theRow_2').style.display="none";
}
}
function openDir( form ) {
var newIndex = form.fieldname.selectedIndex;
cururl = form.fieldname.options[ newIndex ].value;
window.location.assign( cururl );
}
// -->
</script>
</HEAD>
<DIV id="theRow" style="visibility:visible">
<table width="770" border="0" align="center" cellpadding="0" cellspacing="10">
<tr class="title">
<td><strong>cartGURUS Administration - pmGURU</strong> (<? if($_SESSION['valid_admin']) echo"<a href='admin/' >Dashboard</a> | " ?><a href="javascript:void(0);" value="E" onClick="swapIt(this);">Switch Projects</a>)</td>
<td align="right">Logged in as
<?
if($_SESSION['valid_admin']){
$cSQL = mysql_query("SELECT pm_admin_first_name,pm_admin_last_name FROM pm_admin_users WHERE pm_admin_user_id = '" . $_SESSION['valid_admin'] . "'");
while ($row = mysql_fetch_array($cSQL)) {
echo $row['pm_admin_first_name'] . " " . $row['pm_admin_last_name'];
}
} else if($_SESSION['valid_client']){
$cSQL = mysql_query("SELECT pm_client_first_name,pm_client_last_name FROM pm_client_users WHERE pm_client_user_id = '" . $_SESSION['valid_client'] . "'");
while ($row = mysql_fetch_array($cSQL)) {
echo $row['pm_client_first_name'] . " " . $row['pm_client_last_name'];
}
}
?>
(<A
title="Log-out and clear the cookie off your machine"
href="../login.php">Log-out</A>)
</td>
</tr>
</table>
</DIV>
<DIV id="theRow_2" style="display: none;">
<table width="770" align="center" cellpadding="0" cellspacing="10">
<tr class="title">
<td nowrap><strong>Switch to: </strong></td>
<td>
<form>
<select name="fieldname" onChange="openDir( this.form )" class="title">
<?
$query_client_proj = mysql_query("SELECT pm_project_id,pm_project_name FROM pm_projects WHERE pm_client_id='" . $_SESSION['project_info']['0'] . "' ORDER BY pm_project_date");
while ($row = mysql_fetch_array($query_client_proj)) {
?>
<option value="<? echo basename($_SERVER['PHP_SELF']); ?>?client_id=<? echo $_GET['client_id'] ?>&project_id=<? echo $row['pm_project_id'] ?>" <? if ($row['pm_project_id'] == $_SESSION['project_info']['2']) echo 'selected'; ?>><? echo $_SESSION['project_info']['1'] ?> - <? echo $row['pm_project_name'] ?></option>
<?
}
?>
</select>
</form></td>
<td width="100%"><a href="#" name="ship_method" value="S" onClick="swapIt(this);">Cancel</a></td>
</tr>
</table>
</DIV>
Cheers,
macca