> "to*****@gmail.com" <to*****@gmail.com> wrote:
news:11**********************@g47g2000cwa.googlegr oups.com....
Hi,
I have a tabular form that each TR has an onclick event to edit the
row. I also have a div in one of the cells on each row that is a
delete button. My problem is that both onclicks are being fired
when I click on the delete div-button, and as a result the item is
getting deleted, then is opened up for editing.
How do I prevent the TR onclick from happening when the delete
button is used?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript">
var gt=0;
function nef(x){
if(!gt){
alert('do something')
}
else{
x.parentNode.removeChild(x);
gt=0;
}
}
</script>
<title></title>
</head>
<body>
<table summary="">
<tr onclick="nef(this)">
<td>something 0</td>
<td><button onclick="gt=1">delete</button></td>
</tr>
<tr onclick="nef(this)">
<td>something 1</td>
<td><button onclick="gt=1">delete</button></td>
</tr>
</table>
</body>
</html>
--
BootNic Wednesday, January 25, 2006 11:43 PM
When I was young, I was put in a school for retarded kids for two years before they realized I actually had a hearing loss...and they called ME slow!
*Kathy Buckley*