J
John
The following code works fine in Internet Explorer 6 but does not in
Mozilla 1.4. The part that does not work is when you click the "Delete"
link on a particular row, a JavaScript message box should appear to
confirm deletion. In IE6, everything works great. Clicking "OK" will
follow the HREF to the new URL. Clicking "Cancel" completely cancels the
event. In Mozilla, the function never executes; instead, the click
bubbles up to the onclick event for TR. Does anyone know what is
happening? Or does anyone know an alternate way of accomplishing the
same thing? Any help is appreciated.
Thanks,
John
Here's a simplified version of the code:
--
<html>
<body>
<table cellpadding="5" cellspacing="0" border="1">
<tr onclick="javascript:location.href='?view1';">
<td><a href="javascript:if ( confirm( 'Are you sure you want to delete
this record?' ) ) { location.href = '?delete1' };">Delete</a></td>
<td>Field 1A</td>
<td>Field 1B</td>
<td>Field 1C</td>
</tr>
<tr onclick="javascript:location.href='?view2';">
<td><a href="javascript:if ( confirm( 'Are you sure you want to delete
this record?' ) ) { location.href = '?delete2'; }">Delete</a></td>
<td>Field 2A</td>
<td>Field 2B</td>
<td>Field 2C</td>
</tr>
</table>
</body>
</html>
Mozilla 1.4. The part that does not work is when you click the "Delete"
link on a particular row, a JavaScript message box should appear to
confirm deletion. In IE6, everything works great. Clicking "OK" will
follow the HREF to the new URL. Clicking "Cancel" completely cancels the
event. In Mozilla, the function never executes; instead, the click
bubbles up to the onclick event for TR. Does anyone know what is
happening? Or does anyone know an alternate way of accomplishing the
same thing? Any help is appreciated.
Thanks,
John
Here's a simplified version of the code:
--
<html>
<body>
<table cellpadding="5" cellspacing="0" border="1">
<tr onclick="javascript:location.href='?view1';">
<td><a href="javascript:if ( confirm( 'Are you sure you want to delete
this record?' ) ) { location.href = '?delete1' };">Delete</a></td>
<td>Field 1A</td>
<td>Field 1B</td>
<td>Field 1C</td>
</tr>
<tr onclick="javascript:location.href='?view2';">
<td><a href="javascript:if ( confirm( 'Are you sure you want to delete
this record?' ) ) { location.href = '?delete2'; }">Delete</a></td>
<td>Field 2A</td>
<td>Field 2B</td>
<td>Field 2C</td>
</tr>
</table>
</body>
</html>