Skip to content

Commit

Permalink
feat(form): accept 1 in addition to true as checked value for checkboxes
Browse files Browse the repository at this point in the history
When using the behavior set value or set values, checkbox elements were only supporting a real boolean true to check any checkbox.
This PR additionally supports the integer value 1 to have a checkbox checked now.

Closes #987
  • Loading branch information
lubber-de authored and Sean committed Oct 18, 2019
1 parent 2786c33 commit cb8ec75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ $.fn.form = function(parameters) {
}
else if(isCheckbox) {
module.verbose('Setting checkbox value', value, $element);
if(value === true) {
if(value === true || value === 1) {
$element.checkbox('check');
}
else {
Expand Down

0 comments on commit cb8ec75

Please sign in to comment.