|
Subject:
|
Checking a checkbox on click of a row in a table
|
|
Posted By:
|
nkrust
|
Post Date:
|
1/12/2007 11:45:01 PM
|
Hi, How to check a checkbox added in a table by clicking anywhere in the table row?
------------------------------------------------------------------------------------------------------------ Adventure, Play, Alive, Fast, Race, Addict, React, Attack, Heat, Aggression, Blast, Ahead, Escape, Challenge, Anarchy, Game, Real, Damage, Insane, Acclerate,Passion, Fear, Dominate, Crazy, Awesome, Sweat, Habit, Avenge, Balls, Imagine, Viril, Chaos, Amuse, Heavy, Panic, @#!%, Fanatic
|
|
Reply By:
|
joefawcett
|
Reply Date:
|
1/13/2007 10:56:33 AM
|
You could add an onclick handler to the tr, passing the id of the checkbox:
<tr onclick="checkCheckbox('checkbox1');">
then have a function such as:
function checkCheckbox(checkboxId)
{
var chk = document.getElementById(checkboxId);
if (chk) chk.checked = true;
}
--
Joe (Microsoft MVP - XML)
|
|