adamant-state-54102
05/02/2022, 4:20 PMadamant-state-54102
05/02/2022, 4:20 PMtall-dinner-62086
05/02/2022, 4:20 PMadamant-state-54102
05/02/2022, 4:22 PMtall-dinner-62086
05/02/2022, 4:23 PMadamant-state-54102
05/02/2022, 4:26 PMtall-dinner-62086
05/02/2022, 4:27 PMhx-include="input[type=checkbox]"adamant-state-54102
05/02/2022, 4:33 PM{}. However, I just tried again and also looked in devtools, and there it sends the expected payload:
expire=4823&expire=7813&expire=7531&expire=7483
So now there are two questions.
1. Why does the express log not show the payload in req.query, req.body, or req.params?
2. Why does the htmx selector [name='expire'] not give the same results as input[type=checkbox]?adamant-state-54102
05/02/2022, 4:35 PMhx-include="input[name=expire]" does send the correct payload.tall-dinner-62086
05/02/2022, 4:36 PMname="expire"?adamant-state-54102
05/02/2022, 4:39 PMhx-include="input[name=expire]" and the version with single quotes around expire is sending the correct payload too... So that part seems to be fine now (not sure why my first attempt said no payload but let's ignore that).
So at this point it's really an express question rather than an htmx question...adamant-state-54102
05/02/2022, 4:43 PMtall-dinner-62086
05/02/2022, 4:43 PMexpire[] will fix it for you.adamant-state-54102
05/02/2022, 4:44 PMapp.use(express.urlencoded({ extended: true })); because express doesn't parse the body unless you explictly enable that with middleware....
So, problem solved. Thanks for your help!tall-dinner-62086
05/02/2022, 4:45 PMadamant-state-54102
05/02/2022, 5:06 PMtall-dinner-62086
05/02/2022, 5:07 PMtall-dinner-62086
05/02/2022, 5:08 PMHX-Redirect header to explain why the user's access has been revoked, or anything in-between.adamant-state-54102
05/02/2022, 5:18 PMHX-Retarget to retarget to something like <div id="err-msg"> with the server's error message. That strikes me as bad practice though.... it makes things more magical and seems to violate LoB...
Although as a catch-all for unexpected server errors (eg, retargateing to a single "toast" style div at the top of the page) it might be appropriate. Curious what you think @mysterious-toddler-20573 ?mysterious-toddler-20573
05/02/2022, 5:26 PMlemon-carpenter-66863
05/02/2022, 5:56 PMmysterious-toddler-20573
05/02/2022, 5:57 PMmysterious-toddler-20573
05/02/2022, 5:58 PMjs
htmx.onLoad(function(content) {
var sortables = content.querySelectorAll(".sortable");
for (var i = 0; i < sortables.length; i++) {
var sortable = sortables[i];
new Sortable(sortable, {
animation: 150,
ghostClass: 'blue-background-class'
});
}
})melodic-advantage-28381
05/02/2022, 9:00 PMlemon-carpenter-66863
05/02/2022, 9:03 PMmelodic-advantage-28381
05/02/2022, 9:11 PMhundreds-camera-24900
05/02/2022, 10:02 PMhundreds-camera-24900
05/02/2022, 10:02 PMhundreds-camera-24900
05/02/2022, 10:02 PMstrong-machine-61835
05/03/2022, 12:44 AM