ancient-father-3063
07/11/2022, 5:55 AMancient-father-3063
07/11/2022, 5:55 AMhtml
<button type="button" class="btn btn-info" _="on click set #id_matches-4-theirDeck's value to '60'">
set
</button>
ancient-father-3063
07/11/2022, 5:56 AMripe-action-67367
07/11/2022, 6:35 AMripe-action-67367
07/11/2022, 6:35 AMancient-father-3063
07/11/2022, 7:45 AMancient-father-3063
07/11/2022, 8:19 AMancient-father-3063
07/11/2022, 8:19 AMancient-father-3063
07/11/2022, 8:20 AMtall-dinner-62086
07/11/2022, 8:21 AMdoIT
is an event. The first div sends the doIT
event to #div1
with the answer
parameter set to 42.ancient-father-3063
07/11/2022, 8:22 AMancient-father-3063
07/11/2022, 8:23 AMtall-dinner-62086
07/11/2022, 8:23 AMclick
event is triggered, and then things that care about that click listen to the event and do thingstall-dinner-62086
07/11/2022, 8:24 AMchange
. When you change the selected value, the change
event is triggered, and htmx listens to that event and does things when it happens.tall-dinner-62086
07/11/2022, 8:24 AMdoIt
eventtall-dinner-62086
07/11/2022, 8:25 AMon click send change to #id_matches-4-theirDeck
ancient-father-3063
07/11/2022, 8:25 AMancient-father-3063
07/11/2022, 8:25 AMtall-dinner-62086
07/11/2022, 8:26 AMtrigger
instead of send
if that helps you understand that you're triggering an event, they're just synonyms as far as hyperscript is concerned.ancient-father-3063
07/11/2022, 8:28 AMhtml
<button type="button" class="btn btn-info" _="on click set #id_{{theirdeckfield}}'s value to '{{getdeck.theirDeck.id}}' then
trigger change on #id_{{theirdeckfield}} then
set #id_{{theirflavorfield}}'s value to '{{getdeck.theirFlavor.id}}'">
set
</button>
ancient-father-3063
07/11/2022, 8:28 AMfancy-elephant-10660
07/11/2022, 8:28 AMfancy-elephant-10660
07/11/2022, 8:52 AMtall-dinner-62086
07/11/2022, 8:56 AMblue-ghost-19146
07/11/2022, 9:19 AMhx-swap="outerHTML"
rather than innerHTML
, coming from a parent element etc. But it's always possible to troubleshoot and fix. Apart from that, agreed that it shouldn't be much different from anything else at scale AFAIKfancy-elephant-10660
07/11/2022, 9:22 AMblue-ghost-19146
07/11/2022, 9:29 AMtall-dinner-62086
07/11/2022, 9:31 AMid="searchWidget_searchbar"
blue-ghost-19146
07/11/2022, 9:31 AM{% include %}
instead of the whole markup twice! But I do know what you mean. Still, OOB is a nice additional option for swapping extra content, so I think it's worth the double inclusion for the usefulness it providesrefined-waiter-90422
07/11/2022, 2:15 PM