form-serialize
Advanced tools
Comparing version 0.7.1 to 0.7.2
@@ -0,1 +1,5 @@ | ||
# 0.7.2 (2017-06-11) | ||
* Serialize properly radio input with empty value (1b7a042) | ||
# 0.7.1 (2016-03-11) | ||
@@ -2,0 +6,0 @@ |
@@ -81,3 +81,3 @@ // get successful control from form and assemble into object | ||
// if options empty is true, continue only if its radio | ||
if (!val && element.type == 'radio') { | ||
if (val == undefined && element.type == 'radio') { | ||
continue; | ||
@@ -84,0 +84,0 @@ } |
{ | ||
"name": "form-serialize", | ||
"version": "0.7.1", | ||
"version": "0.7.2", | ||
"description": "serialize html forms", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -259,2 +259,15 @@ var assert = require('assert'); | ||
test('radio - empty value', function() { | ||
var form = domify('<form>' + | ||
'<input type="radio" name="foo" value="" checked="checked"/>' + | ||
'<input type="radio" name="foo" value="bar2"/>' + | ||
'</form>'); | ||
hash_check(form, {}); | ||
str_check(form, ''); | ||
empty_check(form, 'foo='); | ||
empty_check_hash(form, { | ||
'foo':'' | ||
}); | ||
}); | ||
// in this case the radio buttons and checkboxes share a name key | ||
@@ -261,0 +274,0 @@ // the checkbox value should still be honored |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30854
678