I am displaying data in a table and want to call a Javascript function when the user clicks on one of the cells in the table.
my php code is
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['Prntr'] . "</td>";
echo "<td> <a href='#' onclick='jumptocartridgex()'>" . $row['Cartridge'] . "</a></td>";
echo "<td>" . $row['Colour'] . "</td>";
echo "<td>" . $row['Type'] . "</td>";
echo "</tr>";
}
The second column shows the correct content and it is displayed as a link however when I click on the cell the script does not run. In addition, if I ever get the script to run, I would like to get the value from $row['Cartridge'] passed to the JS function.
What am I doing wrong?