S
Sonnich Jensen
Hi all!
I have a table, with some items and a checkbox in the last column, for
seleting.
I have an onclick event for the row on the <tr tag, so the entire row
is clickable, that is easier when going throug a list.
The problem I have is that the checkbox, when being clicked will
toggle and then again on the rows event.
It will be toggled twice causing it not to work... well both works...
I have tried to stop the rows event by an onclick on the checkbox, but
that did not work well...
Can anyone help me on this?`
BR
Sonnich
--- table row with event
<tr id='div_$i' onMouseUp=\"check_item('sel_$i');\" >
---- coloumn with checkbox
<td align=\"center\"><input name=\"sel_$i\" type=\"checkbox\" value=
\"$part1[$i]\"
and some JS to handle the row...
function check_item(sel_item)
{
var i;
v = document.forms["myform"];
i=0;
while( (i < v.elements.length) && (v.elements.name !=
sel_item) )
i++;
if(i < v.elements.length)
v.elements.checked= !v.elements.checked;
}
I have a table, with some items and a checkbox in the last column, for
seleting.
I have an onclick event for the row on the <tr tag, so the entire row
is clickable, that is easier when going throug a list.
The problem I have is that the checkbox, when being clicked will
toggle and then again on the rows event.
It will be toggled twice causing it not to work... well both works...
I have tried to stop the rows event by an onclick on the checkbox, but
that did not work well...
Can anyone help me on this?`
BR
Sonnich
--- table row with event
<tr id='div_$i' onMouseUp=\"check_item('sel_$i');\" >
---- coloumn with checkbox
<td align=\"center\"><input name=\"sel_$i\" type=\"checkbox\" value=
\"$part1[$i]\"
and some JS to handle the row...
function check_item(sel_item)
{
var i;
v = document.forms["myform"];
i=0;
while( (i < v.elements.length) && (v.elements.name !=
sel_item) )
i++;
if(i < v.elements.length)
v.elements.checked= !v.elements.checked;
}