Multi-select fields #146
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hey again,
Going back to a similar thing as issue #139, I've recently found out that the multi-selects don't submit subsequent selected values (it only takes the first one chosen), I've put back in my hotfix that I mentioned there (I have the advantage that I don't need to support the other browsers)
For reference, I've readded the fix below into my project (there's also a polyfill here https://github.com/jimmywarting/FormData for it if needed.... using FormData has the advantage of parsing all these fields in the correct way as a standard)
I'm also using the latest version of pjax
Can confirm that only the first selected value in a multi-select is submitted with PJAX's current form handling behaviour. @BehindTheMath, we can use
FormDataif we drop IE9 support, otherwise the fix for this is pretty easy -- I already have something working locally.It seems to me that using
FormDataresults in a drastically request body being sent, since it usesContent-Type: multipart/form-datainstead ofContent-Type: application/x-www-form-urlencoded. I haven't looked into if there's a difference how backend servers parse them, but it's possible that this would be a breaking change, even though the structure of the request body is not documented.I've noticed no adverse effects of using form data :)
@zeraphie If I remember correctly, you're using PHP in the backend. From what I'm told, PHP doesn't differentiate between the two.
However, Express.js for Node uses 2 different libraries to parse
application/x-www-form-urlencodedandmultipart/form-data.I think we should stick with
application/x-www-form-urlencoded(or possibly switch toapplication/json).@robinnorth Can you implement your fix?