Merge pull request #246 from ojensen5115/master

Fix handling of 'multiple' attribute
This commit is contained in:
1cg 2020-12-02 12:53:06 -07:00 committed by GitHub
commit d8b5ef363c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View File

@ -1489,8 +1489,7 @@ return (function () {
if (shouldInclude(elt)) {
var name = getRawAttribute(elt,"name");
var value = elt.value;
if (hasAttribute(elt, 'multiple') &&
getRawAttribute(elt, 'multiple') !== 'false') {
if (elt.multiple) {
value = toArray(elt.querySelectorAll("option:checked")).map(function (e) { return e.value });
}
// include file inputs

View File

@ -13,7 +13,7 @@ htmx is now mature enough that I can recommend it as a general replacement for i
projects. I **don't** think there is a strong reason to port an existing intercooler project to
htmx. I have several large intercooler apps and will not be moving them over any time soon. I can, however, recommend using htmx over intercooler for new projects.
htmx is a different sort of javascript library. It is an HTML & hypertext-oriented reply to the current dominance of javascript-based SPA libraries. It a response to Tom MacWright's question:
htmx is a different sort of javascript library. It is an HTML & hypertext-oriented reply to the current dominance of javascript-based SPA libraries. It is a response to Tom MacWright's question:
["If not SPAs, What?"](https://macwright.com/2020/10/28/if-not-spas.html).
As the [homepage says](https://htmx.org):
@ -30,7 +30,7 @@ HTML-oriented web development was abandoned not because hypertext was a bad idea
htmx began life as [intercooler.js](https://intercoolerjs.org) back in [2013](https://github.com/bigskysoftware/intercooler-js/commit/62d3dbdb5c056ee866aba3575e148de649fc3efe).
In [april](https://github.com/bigskysoftware/htmx/commit/e38dea64dd1065003a0e833d7b469d24e6bc2919) of this year I began work on a jQuery-indepenent & improved version of intercoolerjs, renamed
to htmx. I chose to rename the library because, in working on intercooler, I had come to appreciate that intercooler & htmx were completing HTML as a hypertext rather than idiosyncratic javascript libraries.
to htmx. I chose to rename the library because, in working on intercooler, I had come to appreciate that intercooler & htmx were completing HTML as a hypertext rather than just some funky, idiosyncratic javascript libraries.
In [May](https://github.com/bigskysoftware/htmx/releases/tag/v0.0.1) htmx reached 0.0.1. Soon thereafter I had the good fortune of being contacted by [Ben Croker](https://twitter.com/ben_pylo)
who was interested in htmx as a base for his new reactive library, [Sprig](https://putyourlightson.com/plugins/sprig). Ben was willing to be an early adopter of htmx and pushed the library along
@ -40,7 +40,7 @@ I have been very lucky to the have help and feedback from many contributors in [
I would like to thank [Devmode.fm](https://devmode.fm/) for having me on to [talk about htmx](https://devmode.fm/episodes/dynamic-html-with-htmx) and for cleaning up all my "uhhs" and "umms".
Finally, I would like to thank [Justin Sampson](https://github.com/jsampson), who took a lot of time to explain REST & HATEOAS to me and how intercooler (and now htmx) fit into that model.
Finally, I would like to thank [Justin Sampson](https://github.com/jsampson), who took a lot of time to explain REST & HATEOAS to me and how intercooler (and now htmx) fit into that model for web development.
### Changes

View File

@ -23,6 +23,7 @@ title: </> htmx - Attributes
| [`hx-boost`](/attributes/hx-boost) | progressively enhances anchors and forms to use AJAX requests
| [`hx-confirm`](/attributes/hx-confirm) | shows a confim() dialog before issuing a request
| [`hx-delete`](/attributes/hx-delete) | issues a `DELETE` to the specified URL
| [`hx-encoding`](/attributes/hx-encoding) | changes the request encoding type
| [`hx-ext`](/attributes/hx-ext) | extensions to use for this element
| [`hx-get`](/attributes/hx-get) | issues a `GET` to the specified URL
| [`hx-history-elt`](/attributes/hx-history-elt) | the element to snapshot and restore during history navigation
@ -40,7 +41,8 @@ title: </> htmx - Attributes
| [`hx-swap`](/attributes/hx-swap) | controls how the response content is swapped into the DOM (e.g. 'outerHTML' or 'beforeEnd')
| [`hx-target`](/attributes/hx-target) | specifies the target element to be swapped
| [`hx-trigger`](/attributes/hx-trigger) | specifies the event that triggers the request
| [`hx-vars`](/attributes/hx-vars) | adds to the parameters that will be submitted with the request
| [`hx-vals`](/attributes/hx-vals) | safely adds to the parameters that will be submitted with the request
| [`hx-vars`](/attributes/hx-vars) | dynamically adds to the parameters that will be submitted with the request
| [`hx-ws`](/attributes/hx-ws) | establishes a `WebSocket` or sends information to one
</div>