Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onClick in table

Status
Not open for further replies.

safra

Technical User
Jan 24, 2001
319
NL
Hi,

I have a page with an onClick event on a table. Inside the table I have several buttons. Apparantly, when you click a button inside the table, first the onClick event handler of the table is triggered and afterwards the event handler of the specific button.

I need to find a way to stop the onClick event in the table from being triggered when a button inside the table is clicked. Is this possible?

Thanks,
Ron
 
You could do something similar to...

<script>
var bButton = false;
</script>
<table onclick=&quot;if (bButton==false){alert('table')} else {bButton=false}&quot;>
<tr>
<td>
<input type=button onclick=&quot;bButton=true; alert('hello')&quot;>
</td>
</tr>
</table>
 
Thanks, works great!

Ron

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top