diff --git a/src/htmx.js b/src/htmx.js index 86c9b1e5..9d5447ed 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -1235,6 +1235,9 @@ return (function () { if (shouldInclude(elt)) { var name = getRawAttribute(elt,"name"); var value = elt.value; + if (!!getRawAttribute(elt, 'multiple')) { + value = toArray(elt.querySelectorAll("option:checked")).map(function (e) { return e.value }); + } if (name != null && value != null) { var current = values[name]; if(current) { diff --git a/test/core/ajax.js b/test/core/ajax.js index 08624c76..43f00095 100644 --- a/test/core/ajax.js +++ b/test/core/ajax.js @@ -334,6 +334,38 @@ describe("Core htmx AJAX Tests", function(){ }, 20); }); + it('properly handles multiple select input', function() + { + var values; + this.server.respondWith("Post", "/test", function (xhr) { + values = getParameters(xhr); + xhr.respond(204, {}, ""); + }); + + var form = make('
' + + '