mysterious-toddler-20573
03/31/2023, 12:39 PMwhite-motorcycle-95262
03/31/2023, 2:04 PM<form hx-get="/endpoint/" hx-trigger="change" hx-target="this" hx-swap="outerHTML">
This should be issuing requests whenever any of the form's fields change, correct? :/echoing-account-87376
03/31/2023, 2:13 PMhx-trigger="submit[App.isFormValid(submitter)]"
where isFormValid(...) has the following implementation based on the jQuery validation library:
function isFormValid(submitter) {
const form = $(submitter).closest("form");
if (form.data("submitted")) {
return false;
} else {
const isValid = form.valid();
if (isValid) {
form.data("submitted", true);
}
return isValid;
}
}
What's the best way to wire that up globaly so that I don't have to add the trigger/filter on every form? I was thinking htmx:beforeRequest or htmx:configRequest but I'm not sure if that's the right approach as I want to short-circuit the request if the form is not valid, and I only want to do this on form posts.cuddly-keyboard-70746
03/31/2023, 2:44 PMcuddly-keyboard-70746
03/31/2023, 2:45 PMtall-sundown-41732
03/31/2023, 2:54 PMtall-sundown-41732
03/31/2023, 2:54 PMtall-sundown-41732
03/31/2023, 2:54 PMtall-sundown-41732
03/31/2023, 2:54 PMeager-plumber-49649
03/31/2023, 3:11 PMeager-plumber-49649
03/31/2023, 3:11 PMmysterious-toddler-20573
03/31/2023, 3:23 PMtall-sundown-41732
03/31/2023, 3:54 PMtall-sundown-41732
03/31/2023, 3:59 PMdiv
with a sse-swap
attribute set to some customEvent
, won't that div get future events named customEvent
?mysterious-toddler-20573
03/31/2023, 7:57 PMmysterious-toddler-20573
03/31/2023, 7:58 PMhttps://cdn.discordapp.com/attachments/725789747212976259/1091451515706818600/CleanShot_2023-03-31_at_13.57.59.gifβΎ
shy-knife-59740
03/31/2023, 11:19 PMshy-knife-59740
03/31/2023, 11:19 PMnumerous-agent-22346
04/01/2023, 8:49 AMshy-knife-59740
04/01/2023, 4:08 PMshy-knife-59740
04/01/2023, 4:09 PMshy-knife-59740
04/01/2023, 4:10 PMwitty-garage-37227
04/01/2023, 8:02 PMhttps://cdn.discordapp.com/attachments/725789747212976259/1091814833789349928/image.pngβΎ
https://cdn.discordapp.com/attachments/725789747212976259/1091814834007461978/image.pngβΎ
witty-garage-37227
04/01/2023, 8:02 PMwitty-garage-37227
04/01/2023, 8:03 PMwitty-garage-37227
04/01/2023, 8:07 PMmysterious-toddler-20573
04/01/2023, 8:37 PM<div/>
above that responsemysterious-toddler-20573
04/01/2023, 8:37 PMwitty-garage-37227
04/02/2023, 12:58 AMfuture-table-82610
04/02/2023, 5:35 AMhx-boost
, I've never really used it before, but I've enabled it on a web app and it's causing me some problems with javascript. Not doing anything fancy, just some bootstrap modals, or loading a calendar function. All work when I do a clean refresh, or when I disable boost. I can't be the only person having these kind of issues, so does it sound familiar?