I need to pass a variable to javascript so that i can popup a window. it must be a defined sized popup window and display the appropriate data from mysql. My code does popup a window, however it doesn't link the proper id to the page which opens. it seems to open a popup with the same ExpenseID no matter which record is clicked on. I'd appreciate any helpfui ideas you may have.
this is just an excerpt from my code to simplify troubleshooting.
Code: Select all
<?php
echo "<tbody>";
echo "<tr class='bb' onMouseOver=\"this.bgColor = '#dbebf7'\" onMouseOut =\"this.bgColor = '#FFFFFF'\">";
?>
<script language="JavaScript" type="text/javascript">
function confirmExpenseRecord()
{window.open("er_expenserecordsavedb.php?ExpenseID=<?php echo $result['ExpenseID'] ?>","_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, resizable=yes, width=800, height=550");}
</script>
<?php
echo '<td nowrap valign="top"><a href="er_expenserecordsavedb.php?ExpenseID=' . $result['ExpenseID'] .'" onclick="confirmExpenseRecord(); return false;">'. $result['ActionItem'].' </a></td>';
echo '<td nowrap valign="top"><a href="er_expenserecordsavedb.php?ExpenseID=' . $result['ExpenseID'] .'" onclick="confirmExpenseRecord(); return false;">'. $result['CompanyName'].' </a></td>';
echo '<td nowrap valign="top">' . $result['DateFirstDay'] . '</td>';
echo '<td nowrap valign="top">' . "$". number_format($result['MegaInvoiceAmount'],2) . '</td>';
echo '<td nowrap valign="top">' . $result['DateService'] . '</td>';
echo '<td nowrap valign="top">' . nl2br($result['ActionTextField']) . '</td>';
echo '<td nowrap valign="top">' . $result['PaidBy'] . '</td>';
echo "</tr>";
echo "<tbody>";
?>