A Friend in Need is a Friend in Deed.
Become a Member at ITTreats.com !! Share Your invaluable Experience to Fellow Programmers. Signup, Start Blogging and support fellow Techies.

How to Make Read only Check Boxes

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 ??

Article Written by : adrevol
( Articles Submitted : 47 Articles Commented : )




Leave a Reply