mysterious-toddler-20573
06/13/2021, 10:56 PMmysterious-toddler-20573
06/13/2021, 10:56 PMon htmx:afterSwap log memysterious-toddler-20573
06/13/2021, 10:56 PMme is what you expectmysterious-toddler-20573
06/13/2021, 10:56 PMmysterious-toddler-20573
06/13/2021, 10:57 PMon htmx:afterSwap reset() me
using a pseudo-command: https://hyperscript.org/docs/#pseudo-commandsrich-oxygen-98159
06/14/2021, 12:43 AM<form method="post" action="{% url "form_add" %}" style="display: inline;" id="AddTaskForm" hx-post="{% url "form_add" %}" hx-swap="outerHTML" hx-target="#task-table" _="on htmx:afterSwap log me"><input type="text" name="description"><button type="submit" class="add_btn" name="submit">Add Task</button></form> It looks like the log doesn't fire at all (although the form and button work just fine, and the table swaps out)mysterious-toddler-20573
06/14/2021, 12:46 AMhtmx:afterRequestmysterious-toddler-20573
06/14/2021, 12:46 AMhtmx:afterSwap is fired on the target, not the initiator of the requestmysterious-toddler-20573
06/14/2021, 12:46 AMmysterious-toddler-20573
06/14/2021, 12:46 AMmysterious-toddler-20573
06/14/2021, 12:47 AMmysterious-toddler-20573
06/14/2021, 12:48 AMhtml
<form ... _="on htmx:afterRequest reset() me"> ...rich-oxygen-98159
06/14/2021, 12:53 AMhtmx:afterRequest log me doesn't seem to fire either, I also tired htmx:afterRequest log 'test' and nothing showed up in the log. Once I've got a few of these things sorted out the library seems great, easy addition for a few more interactive bits and pieces. In this case I probably should have just left the form submitting the whole page, but it seems better to get this sorted out.rich-oxygen-98159
06/14/2021, 1:02 AMafterRequest log 'test' doesn't seem to firemysterious-toddler-20573
06/14/2021, 1:55 AMmysterious-toddler-20573
06/14/2021, 1:55 AMmysterious-toddler-20573
06/14/2021, 1:57 AMmonitorEvents() method from the console in Chrome to see what events are firing on the form:mysterious-toddler-20573
06/14/2021, 1:57 AMmysterious-toddler-20573
06/14/2021, 1:58 AMjs
monitorEvents(document.getElementById("myForm"))mysterious-toddler-20573
06/14/2021, 1:58 AMmysterious-toddler-20573
06/14/2021, 1:58 AMmysterious-toddler-20573
06/14/2021, 1:58 AMmysterious-toddler-20573
06/14/2021, 1:59 AMmysterious-toddler-20573
06/14/2021, 1:59 AMrich-oxygen-98159
06/14/2021, 3:54 AMrich-oxygen-98159
06/14/2021, 3:54 AMrich-oxygen-98159
06/14/2021, 3:56 AMsalmon-xylophone-28580
06/14/2021, 9:12 AMmysterious-toddler-20573
06/14/2021, 1:35 PM