I have a fiddle for this which is working for Input check boxes the same i would like to have for asp check boxes how can i
http://jsfiddle.net/Town/B2n2J/
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Munesh SharmaPosted Oct 24, 2015, 7:07 AM
Munesh SharmaPosted Oct 24, 2015, 7:07 AM
Add 'this' to the calling function:
name="checkbox_{{ word.id }}"
onclick="highlight_row('row_{{ forloop.counter }}',this)" />
Now you can use the checked state of the chechbox to determine what to do:
function highlight_row(row_id,checkbox)
{
var row = document.getElementById(row_id);
row.style.background = checkbox.checked ? "yellow" : "";
}
Gagan VermaPosted Oct 24, 2015, 5:37 AM
Suthish NairPosted Jun 29, 2011, 11:10 AM
Instead of using onclick use onchange and try..
Or on Page Load
chkExit.Attributes.Add("onchange", "Show()");
VivekhPosted Jun 29, 2011, 9:06 AM
Mahak GuptaPosted Jun 29, 2011, 9:01 AM
On the onclick event of the chk1 we write the following javascript function (Show()), to change the color of the chk1 background
Javascript function: