mdbootstrap / bootstrap-toggle-buttons

Bootstrap-toggle-buttons has moved to https://github.com/nostalgiaz/bootstrap-switch
https://github.com/nostalgiaz/bootstrap-switch
Apache License 2.0
1.02k stars 92 forks source link

JS does not validate input is a checkbox., #27

Closed thawkins closed 11 years ago

thawkins commented 11 years ago

I have been working with Zend framework, which in its low level handling of checkboxes adds a hidden field containing the unchecked value, above each checkbox. This is to ensure that a checkbox control always returns a value even if it is unchecked, ZF allows you to set the checked and unchecked values separately.

Unfortunately this means that the two input statements (hidden and checkbox) are very tightly bound, and while its easy to wrap the pair in a div, getting in to wrap just the checkbox is near impossible without altering the ZF framework.

However by changing all of the .find('input') statements in jquery-button-toggle.js to

.find('input[type="checkbox"]')

the problem goes away as only the checkbox elements are acted upon.

nostalgiaz commented 11 years ago

Can you send me a pull request? :)