I have a table that is populated by php/mysql. I would like to have it were when you click on a row any where on the row the check box for that row gets checked. I have been searching the net for days looking for a way to do this by have not found any thing. Any help would be great Thanks!!!
crazygolfer
0
Newbie Poster
Recommended Answers
Jump to PostCrazygolfer,
Try this,
function checkRow(chBoxId){ var ch = document.getElementById(chBoxId); if(ch){ ch.checked = true; } }
<form ....> <table border> <tr> <td><input type="checkbox" name="r1"></td> <td onclick="checkRow('r1')">Row 1 Text 1</td> <td onclick="checkRow('r1')">Row 1 Text 2</td> <td onclick="checkRow('r1')">Row 1 Text 3</td> </tr><tr> <td><input type="checkbox" name="r2"></td> <td …
Jump to Posthtml <label> tag
anything within the label is clickable for the checkbox<label for='check1'>Entire Row<!-- any kind of code --> <input type='checkbox' id='check1' value='yes'> Yes <!-- any kind of code --></label>
All 6 Replies
Airshow
416
WiFi Lounge Lizard
Team Colleague
almostbob
866
Retired: passive income ROCKS
almostbob
866
Retired: passive income ROCKS
crazygolfer
0
Newbie Poster
Airshow
416
WiFi Lounge Lizard
Team Colleague
ogunm
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.