Page 1 of 1

click on link triggers click on cell

Posted: Fri Apr 13, 2007 11:03 am
by sarris
Hi there...I have a table which is clickable and executes a function

Code: Select all

var myfnc3 = "mouseclick_table("+id+")";
house.setAttribute("onclick",myfnc3);

function mouseclick_table(id){
	table = document.getElementById(id);
	table.setAttribute("border" ,"1");
	table.setAttribute("bordercolor","#003366");
}
works ok...
in that table, in one cell i have a link

Code: Select all

<a href = "javascript: somefunction()">
of course when i click that link the mouseclick_table triggers as well...how can i make it so when i click on that certain link, the onclick function of the table doesnt execute?

thanks

Posted: Fri Apr 13, 2007 2:49 pm
by feyd
Cancel the bubble.

Posted: Sat Apr 14, 2007 2:13 am
by sarris
ok...so i added

Code: Select all

window.event.cancelBubble = true;
into somefunction()...
still triggers both.

ps: i am using mozzila

Posted: Mon Apr 16, 2007 11:16 am
by sarris
anyones knows? am i using the cancel bubble wrongly???