Skip to content

Commit

Permalink
Do not add null results to object - null results are for unsuccessful…
Browse files Browse the repository at this point in the history
… input values, so shouldn't be included in results
  • Loading branch information
mcintyre321 committed May 16, 2012
1 parent 985a3f3 commit 866afd3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/form2js.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,12 @@ var form2js = (function()

while (currentNode)
{
result = result.concat(extractNodeValues(currentNode, nodeCallback, useIdIfEmptyName));
var currentResult = extractNodeValues(currentNode, nodeCallback, useIdIfEmptyName);
for (var i = 0; i < currentResult.length;i++ ) {
if(currentResult[i].value !== null) {
result[result.length] = currentResult[i];
}
}
currentNode = currentNode.nextSibling;
}

Expand Down

0 comments on commit 866afd3

Please sign in to comment.