acoustic-lawyer-26558
01/20/2022, 2:34 PMmysterious-toddler-20573
01/20/2022, 2:35 PMmysterious-toddler-20573
01/20/2022, 2:35 PMmysterious-toddler-20573
01/20/2022, 2:35 PMmysterious-toddler-20573
01/20/2022, 2:36 PMacoustic-lawyer-26558
01/20/2022, 2:36 PMmysterious-toddler-20573
01/20/2022, 2:37 PMmysterious-toddler-20573
01/20/2022, 2:38 PMacoustic-lawyer-26558
01/20/2022, 2:46 PMacoustic-lawyer-26558
01/20/2022, 2:51 PMbumpy-zoo-26881
01/20/2022, 3:47 PMfresh-controller-36545
01/20/2022, 3:52 PMHX-Refresh header in your server response to 'true' – quick and easy. Sounds like you're using Django; so:
python
return HttpResponse('this computes', headers={'HX-Refresh': 'true'})brave-magazine-28098
01/20/2022, 5:51 PMmagnificent-boots-1658
01/20/2022, 5:56 PM<option> within an HTMX-enabled <select> ignore HTMX function? As a matter of example, I have a <select> with a list of options, most of which should trigger the hx-post, but a final option of "Add another option" which should trigger some local behavior to display UX for creating a new option. That last option shouldn't hx-post anything, but putting hx-post on the select seems to be an all-or-nothing directive.narrow-room-51024
01/20/2022, 6:03 PMmost-jelly-15242
01/20/2022, 6:03 PMhx-trigger="change[target.value !== 'last-option-value']"magnificent-boots-1658
01/20/2022, 6:04 PMmagnificent-boots-1658
01/20/2022, 6:04 PMnarrow-room-51024
01/20/2022, 6:10 PMmysterious-toddler-20573
01/20/2022, 6:23 PMmysterious-toddler-20573
01/20/2022, 6:23 PMbland-coat-6833
01/20/2022, 7:04 PMlocalstorage but I’ve been hearing that all the cool kids keep their state on the server, so I want to htmx their theme choice to the backend but then update an attribute on body (or the html element if possible) with the response so that the colours update.astonishing-oil-69230
01/20/2022, 7:04 PMbland-coat-6833
01/20/2022, 7:05 PMastonishing-oil-69230
01/20/2022, 7:05 PMbland-coat-6833
01/20/2022, 7:06 PMbland-coat-6833
01/20/2022, 7:07 PMmysterious-toddler-20573
01/20/2022, 7:11 PMHX-Trigger and listen for it on the body, passing in the class you want swapped on.mysterious-toddler-20573
01/20/2022, 7:11 PMastonishing-oil-69230
01/20/2022, 7:12 PM