From 688c64551a0bbedf602d9641e0ba8452bdbd4332 Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 28 Jul 2015 17:31:03 -0400 Subject: [PATCH] Fix unchecked checkboxes not being accessible with get value --- RELEASE-NOTES.md | 1 + src/definitions/behaviors/form.js | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index e18011b75..4cb2f2718 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -13,6 +13,7 @@ - **Modal** - Increased `close` specificity, modal will now only close on `> .close` #2736 **Additional Bugs** +- **Form Validation** - Fixed issue with `get value(s)` where unchecked checkboxes would not correctly retrieve values - **Input** - `labeled input` now keeps border on label edge so that focus color appears correctly - **Input** - Input now will reset `font-weight` and `font-style` if set on parent; - **Menu** - Added `flex: 0 0 auto` to menu item to make sure menu do not collapse text content to reduce space diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index e19bcab85..43594ef19 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -455,11 +455,10 @@ $.fn.form = function(parameters) { } if(isCheckbox) { if(isChecked) { - values[name].push(value); + values[name].push(true); } else { - module.debug('Omitted unchecked checkbox', $field); - return true; + values[name].push(false); } } else { @@ -477,8 +476,7 @@ $.fn.form = function(parameters) { values[name] = true; } else { - module.debug('Omitted unchecked checkbox', $field); - return true; + values[name] = false; } } else {