properly handles multiple select input referred to externally10ms ‣
var values
this.server.respondWith('Post', '/include', function(xhr) {
values = getParameters(xhr)
xhr.respond(204, {}, '')
})
make('<select id="multiSelect" name="multiSelect" multiple="multiple">' +
'<option id="m1" value="m1">m1</option>' +
'<option id="m2" value="m2">m2</option>' +
'<option id="m3" value="m3">m3</option>' +
'<option id="m4" value="m4">m4</option>' +
'</select>')
var div = make('<div hx-post="/include" hx-include="#multiSelect"></div>')
div.click()
this.server.respond()
values.should.deep.equal({})
byId('m1').selected = true
div.click()
this.server.respond()
values.should.deep.equal({ multiSelect: 'm1' })
byId('m1').selected = true
byId('m3').selected = true
div.click()
this.server.respond()
values.should.deep.equal({ multiSelect: ['m1', 'm3'] })