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)

Go to topic 54774

Return to index page 64
Return to index page 63
Return to index page 62
Return to index page 61
Return to index page 60
Return to index page 59
Return to index page 58
Return to index page 57
Return to index page 56
Return to index page 55