Skip to content

Commit bffbdab

Browse files
committed
Handle request data with arrays in postCriteria
1 parent 49fc321 commit bffbdab

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Griddly/Scripts/griddly.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,17 @@
14771477
inputs += '<input type="hidden" name="' + token.attr("name") + '" value="' + token.val() + '" />';
14781478

14791479
for (var key in request)
1480-
inputs += '<input name="' + key + '" value="' + request[key] + '" />';
1480+
{
1481+
var value = request[key];
1482+
1483+
if (value.constructor === Array)
1484+
{
1485+
for (var i = 0; i < value.length; i++)
1486+
inputs += '<input name="' + key + '" value="' + value[i] + '" />';
1487+
}
1488+
else
1489+
inputs += '<input name="' + key + '" value="' + value + '" />';
1490+
}
14811491

14821492
$("<form action=\"" + url + "\" method=\"post\">" + inputs + "</form>")
14831493
.appendTo("body").submit().remove();

0 commit comments

Comments
 (0)