IE6 vs. Mozilla

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,147
Messages
2,570,833
Members
47,377
Latest member
MableYocum

Latest Threads

Top