Fix a bug where the value of <option> would not get sent if falsy

According to the spec, the value attribute should be sent if it
exists, even if it's falsy.
This commit is contained in:
Behind The Math
2018-05-29 22:21:32 -04:00
parent 8dbe7553b9
commit 5885d76f37

View File

@@ -68,7 +68,7 @@ function parseFormElements(el) {
for (var i = 0; i < element.options.length; i++) {
opt = element.options[i]
if (opt.selected) {
values.push(opt.value || opt.text)
values.push(opt.hasAttribute("value") ? opt.value : opt.text)
}
}
}