How we can make a Chek box readonly? Even if we provide Readonly attribute you still can check or uncheck the checkbox..
then how we can make a CheckBox ReadOnly ??
Here is the simple solution, we can do this with Javascript. here is how it goes
write a onclick even for the desired checkbox, and check weather it is checked , if it is check then make that checked as false vice versa
<input type=\”checkbox\” value=\”xyz\” checked onclick=\”javascript:if (this.checked==true) this.checked=false; else this.checked=true;\” />
Here is the example Below :
Try to Uncheck Me :
Simple is\’t it ??
