Snoopy
Newbie
Posts: 1
Registered: 2/24/2004
Member Is Offline
|
| posted on 2/24/2004 at 05:12 PM |
|
|
Problem with onClick and inline Links in a table
Hello together
I created a table with javascript calls inside the the table and an active onClick for the complete table. When i click on the area of the inside link
on a row however both javascript functions will started. I tested it with alert messages inside these both functions.
the problem ist that, both function send a form submit and i am not able to decide which code should running.
did anybody have similar problems ? which solutions exist ?? hope you can help me...
Regards
Michael
|
|
|
Dean
Newbie
Posts: 1
Registered: 11/12/2004
Member Is Offline
|
| posted on 11/12/2004 at 03:52 PM |
|
|
I'm having the same problem
Does anyone know the answer to this question?
Thanks!
|
|
|
jchastain
Newbie
Posts: 1
Registered: 11/30/2004
Member Is Offline
|
| posted on 11/30/2004 at 03:33 AM |
|
|
I am running into a similar issue. The first column of my table is a checkbox, but with the onClick function in place, clicking on the form field
fires the onClick function. Is it possible to limit the onClick function to certain columns, or is there a way to abort this function based upon
which column was clicked?
Any help would be appreciated.
Thanks
-- Jeff Chastain
|
|
|
kvv
Super Administrator
Posts: 86
Registered: 6/17/2003
Member Is Offline
|
| posted on 12/16/2004 at 10:11 AM |
|
|
To suppress row onclick event when checkbox is clicked you can use the
following functions:
var tmp_onclick_func = '';
function suppress_onClick(rng){
tmp_onclick_func = (rng.parentNode).parentNode.onclick;
(rng.parentNode).parentNode.onclick = false;
}
function restore_onClick(rng){
(rng.parentNode).parentNode.onclick = tmp_onclick_func;
}
So checkbox in the content array should look like the following:
'<input type="checkbox" value="1" name="checkbox1"
onclick="suppress_onClick(this)" onchange="restore_onClick(this)">'
|
|
|