mysterious-toddler-20573
05/05/2022, 1:48 PMadamant-state-54102
05/05/2022, 1:59 PM<input name="expire<%= deal.id %>" type="hidden" value="<%= deal.id %>">
<button hx-swap="outerHTML"
hx-include="input[name=expire<%= deal.id %>]"
hx-post="/expire"
value="<%= deal.id %>"
<%= deal.expired ? 'disabled' : '' %>
>
Expire
</button>
If anyone has a better idea, please lmk. I'm still unclear why the button's value isn't sent by default... I'm guessing it only does that for <input> types?
The one other option I tried is creating separate forms for each element, but then ended up being bulkier.
Finally, what about posting to /expire?dealId=123?mysterious-toddler-20573
05/05/2022, 2:02 PMgorgeous-ghost-95789
05/05/2022, 2:15 PMprocessNode on the root element of the web socket (ie, the tag with the hx-ext attribute)curved-lock-14925
05/05/2022, 10:22 PMmost-activity-91725
05/05/2022, 10:31 PMcurved-lock-14925
05/05/2022, 10:33 PMmysterious-tomato-195
05/06/2022, 1:13 PMhx-target only swaps the first element it finds, is there a way to target multiple elements?mysterious-tomato-195
05/06/2022, 1:27 PMmysterious-toddler-20573
05/06/2022, 1:27 PMmysterious-toddler-20573
05/06/2022, 1:27 PMmysterious-tomato-195
05/06/2022, 1:28 PMmysterious-tomato-195
05/06/2022, 1:28 PMmysterious-tomato-195
05/06/2022, 1:30 PMmysterious-tomato-195
05/06/2022, 1:30 PM<div hx-swap-oob="#mobile-element">...</div>
<div hx-swap-oob="#desktop-element">...</div>mysterious-toddler-20573
05/06/2022, 1:33 PMmysterious-toddler-20573
05/06/2022, 1:33 PMmysterious-tomato-195
05/06/2022, 1:36 PMeager-tiger-27508
05/06/2022, 2:22 PM<div hx-swap-oob=".my-class">..</div>
IDs should be unique to an element, so I think the current behavior of hx-swap-oob makes sense.mysterious-tomato-195
05/06/2022, 2:29 PMhx-swap doesn't do that. I'm using another approach right now btweager-tiger-27508
05/06/2022, 2:30 PMThe value of the hx-swap-oob can be:
true
any valid hx-swap value
any valid hx-swap value, followed by a colon, followed by a CSS selector
If the value is true or outerHTML (which are equivalent) the element will be swapped inline.
If a swap value is given, that swap strategy will be used.
If a selector is given, all elements matched by that that selector will be swapped. If not, the element with an ID matching the new content will be swapped.eager-tiger-27508
05/06/2022, 2:31 PMmysterious-tomato-195
05/06/2022, 2:32 PMmysterious-toddler-20573
05/06/2022, 4:20 PMjolly-kite-167
05/06/2022, 4:33 PMmysterious-toddler-20573
05/06/2022, 4:36 PMmysterious-toddler-20573
05/06/2022, 4:36 PMjolly-kite-167
05/06/2022, 4:41 PMgorgeous-airport-54386
05/06/2022, 5:01 PMmysterious-toddler-20573
05/06/2022, 5:02 PM