drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.38k stars 1.62k forks source link

Icheck Js provide readonly feature or not? #275

Open ghost opened 9 years ago

ghost commented 9 years ago

It is provide disabled but not provide readonly

can you give solution if i want to do readonly

ghost commented 9 years ago

a readonly element is just not editable, but gets sent when the according form submits. a disabled element isn't editable and isn't sent on submit. another difference is that readonly elements can be focused (and getting focused when "tabbing" through a form) while disabled elements can't.

jhyland87 commented 9 years ago

I actually need the same thing. I cant just 'disable' the checkbox, because that wont send the value through the form if its checked, I need it to be checked, and not able to be unchecked. The "readonly" attribute for regular inputs is what im looking for, can that be accomplished with iCheck?

jhyland87 commented 9 years ago

I got half way through switching from Labelauty to iCheck, before I thought to test this out, and noticed disabled isnt the same as readonly (which is the right way), but that I also couldnt find a readonly method..

Let me know so I can switch back if needed :-\

jhyland87 commented 9 years ago

@ishanishah1 - Did you find a solution to this? or an alternative plugin? Ive been trying, I even gave editing the source a go, but it seems to be that everything is a ternary operator, just checking or unchecking, disabling or enabling, so adding a 3rd setting readonly would involve redoing a lot more than im willing to do