https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • i have not had a drink of water in five years
    m

    mysterious-toddler-20573

    03/31/2023, 12:39 PM
    i have not had a drink of water in five years
  • `<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? :/
    w

    white-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? :/
  • Hi y'all! Say i have the following trigger with an event filter on a form: ```hx-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.
    e

    echoing-account-87376

    03/31/2023, 2:13 PM
    Hi y'all! Say i have the following trigger with an event filter on a form:
    Copy code
    hx-trigger="submit[App.isFormValid(submitter)]"
    where isFormValid(...) has the following implementation based on the jQuery validation library:
    Copy code
    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.
  • To me the real discussion with htmx tends to be client side vs server side. Major corporations push client side because with their scale they can save a lot of money by letting clients generate their uis and offload server work
    c

    cuddly-keyboard-70746

    03/31/2023, 2:44 PM
    To me the real discussion with htmx tends to be client side vs server side. Major corporations push client side because with their scale they can save a lot of money by letting clients generate their uis and offload server work
  • But a lot of humbler websites don’t tend to enjoy those benefits and just join the chuchu-train
    c

    cuddly-keyboard-70746

    03/31/2023, 2:45 PM
    But a lot of humbler websites don’t tend to enjoy those benefits and just join the chuchu-train
  • Following-up on a couple of questions I had a couple of days ago, I managed to use SSE to stream a response from my (Flask) server to my app.
    t

    tall-sundown-41732

    03/31/2023, 2:54 PM
    Following-up on a couple of questions I had a couple of days ago, I managed to use SSE to stream a response from my (Flask) server to my app.
  • But then, when my app is one, HTMX tries to connect to SSE again and my app does all the work again.
    t

    tall-sundown-41732

    03/31/2023, 2:54 PM
    But then, when my app is one, HTMX tries to connect to SSE again and my app does all the work again.
  • Over, and over πŸ˜†
    t

    tall-sundown-41732

    03/31/2023, 2:54 PM
    Over, and over πŸ˜†
  • Did I do something wrong? How do I tell HTMX that I'm done with that SSE connection?
    t

    tall-sundown-41732

    03/31/2023, 2:54 PM
    Did I do something wrong? How do I tell HTMX that I'm done with that SSE connection?
  • wtf, hyperscript is also bigskysoftware?
    e

    eager-plumber-49649

    03/31/2023, 3:11 PM
    wtf, hyperscript is also bigskysoftware?
  • Wondering if idiomorph will be part of htmx v2
    e

    eager-plumber-49649

    03/31/2023, 3:11 PM
    Wondering if idiomorph will be part of htmx v2
  • yes and yes πŸ™‚
    m

    mysterious-toddler-20573

    03/31/2023, 3:23 PM
    yes and yes πŸ™‚
  • My SSE response can't return another listener for future events?
    t

    tall-sundown-41732

    03/31/2023, 3:54 PM
    My SSE response can't return another listener for future events?
  • In other words, if I return a `div` with a `sse-swap` attribute set to some `customEvent`, won't that div get future events named `customEvent`?
    t

    tall-sundown-41732

    03/31/2023, 3:59 PM
    In other words, if I return a
    div
    with a
    sse-swap
    attribute set to some
    customEvent
    , won't that div get future events named
    customEvent
    ?
  • demo of the new View Transition API support coming in htmx 1.9.0: demo of the view transition support: https://dev.htmx.org/examples/animations/#view-transitions
    m

    mysterious-toddler-20573

    03/31/2023, 7:57 PM
    demo of the new View Transition API support coming in htmx 1.9.0: demo of the view transition support: https://dev.htmx.org/examples/animations/#view-transitions
  • m

    mysterious-toddler-20573

    03/31/2023, 7:58 PM

    https://cdn.discordapp.com/attachments/725789747212976259/1091451515706818600/CleanShot_2023-03-31_at_13.57.59.gifβ–Ύ

  • https://tenor.com/view/jerma-slavicskipper-what-gif-21452349
    s

    shy-knife-59740

    03/31/2023, 11:19 PM
    https://tenor.com/view/jerma-slavicskipper-what-gif-21452349
  • Amazing
    s

    shy-knife-59740

    03/31/2023, 11:19 PM
    Amazing
  • Hi, by chance do you have some "notes" or resource about the history of the web that you reccomend?
    n

    numerous-agent-22346

    04/01/2023, 8:49 AM
    Hi, by chance do you have some "notes" or resource about the history of the web that you reccomend?
  • learn about webrings
    s

    shy-knife-59740

    04/01/2023, 4:08 PM
    learn about webrings
  • its a huge part of web history
    s

    shy-knife-59740

    04/01/2023, 4:09 PM
    its a huge part of web history
  • thats what people used to find other peoples websites before google started scraping the web to index everything
    s

    shy-knife-59740

    04/01/2023, 4:10 PM
    thats what people used to find other peoples websites before google started scraping the web to index everything
  • hello everyone, not sure what I am doing wrong but for some strange reason when a return a replacement row for a table, htmx strips out all td tags but their content still exists
    w

    witty-garage-37227

    04/01/2023, 8:02 PM
    hello everyone, not sure what I am doing wrong but for some strange reason when a return a replacement row for a table, htmx strips out all td tags but their content still exists

    https://cdn.discordapp.com/attachments/725789747212976259/1091814833789349928/image.pngβ–Ύ

    https://cdn.discordapp.com/attachments/725789747212976259/1091814834007461978/image.pngβ–Ύ

  • Image 1 is the response while image 2 is what htmx injected into the dom
    w

    witty-garage-37227

    04/01/2023, 8:02 PM
    Image 1 is the response while image 2 is what htmx injected into the dom
  • it seem to have removed all td tags leaving its content
    w

    witty-garage-37227

    04/01/2023, 8:03 PM
    it seem to have removed all td tags leaving its content
  • <@725789255590215732> this is a very strange I would have sworn on my grand kids that this used to work
    w

    witty-garage-37227

    04/01/2023, 8:07 PM
    @mysterious-toddler-20573 this is a very strange I would have sworn on my grand kids that this used to work
  • i see a `<div/>` above that response
    m

    mysterious-toddler-20573

    04/01/2023, 8:37 PM
    i see a
    <div/>
    above that response
  • that's almost certainly breaking the parsing
    m

    mysterious-toddler-20573

    04/01/2023, 8:37 PM
    that's almost certainly breaking the parsing
  • That is an hx-swap-oob element. Even when I remove that it still doesn't work
    w

    witty-garage-37227

    04/02/2023, 12:58 AM
    That is an hx-swap-oob element. Even when I remove that it still doesn't work
  • Hey All, I've got a question about `hx-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?
    f

    future-table-82610

    04/02/2023, 5:35 AM
    Hey All, I've got a question about
    hx-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?
1...108310841085...1146Latest