vsn4ik / bootstrap-checkbox

A checkbox component based on Bootstrap framework.
https://vsn4ik.github.io/bootstrap-checkbox/
MIT License
214 stars 61 forks source link

Readonly Attribute #20

Closed LorenDorez closed 6 years ago

LorenDorez commented 8 years ago

The Checkbox Plug isnt respecting the ReadOnly attribute.

I need to use ReadOnly so that the control still postback to the server, because disabled fiedls dont post

LorenDorez commented 8 years ago

I recommend changing the Disabled check to as follows

FROM if (this.element.disabled) {

TO if (this.element.disabled || this.element.readOnly) {

vsn4ik commented 8 years ago

Readonly not supported for input[type="checkbox"] by default.

For readonly use

<input type="hidden" name="..." value="0|1">
<p>This is readonly</p>

Also see: http://getbootstrap.com/css/#forms-controls-static

vsn4ik commented 6 years ago

Fixed in v1.5.0. Thanks @LorenDorez!