https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • a

    adorable-fish-28954

    11/19/2022, 12:46 AM
    Looking at using a Select dropdown as a nav and would love it i could trigger a get per it looks like it might not be possible currently?
  • a

    adorable-fish-28954

    11/19/2022, 12:47 AM
    kinda like this in theory
    Copy code
    <select name="nav" id="nav">
            <option value="#">Where to?</option>
            <option value=""  hx-get="/addbatch" hx-target=".body">Add a Shipment</option>
        </select>
  • g

    gorgeous-ghost-95789

    11/19/2022, 2:23 AM
    It is a great demo of htmx’s extensions. There are some gotchas depending on your http headers. Of you use preload, make sure to watch your HTTP vary header to make sure your browser can use its cache effectively.
  • g

    gorgeous-ghost-95789

    11/19/2022, 2:24 AM
    Htmx is so simple/powerful, it’s enabling me to make an app that would be simply impossible to built otherwise.
  • s

    salmon-xylophone-28580

    11/19/2022, 9:18 AM
    Sometimes people say that htmx is not for big projects. I think that's BS. Yesterday I read the Go style guide of Google. If the company with one of the largest code bases underlines simplicity over and over again, then this means to me: simplicity like htmx are even more important for big projects. But why is there no huge project using htmx? Time.... Big projects need time to be created or changed.
  • e

    echoing-nest-31408

    11/19/2022, 1:09 PM
    Is there a way for me to get hx-get to include some form element values as URL parameters? I want a div somewhere in my form that I replace with some extra details depending on how the form is filled out (duplicate record check)
  • b

    boundless-vase-80440

    11/19/2022, 1:12 PM
    Big projects sometimes small value.
  • b

    boundless-vase-80440

    11/19/2022, 1:13 PM
    Many such...
  • m

    mysterious-toddler-20573

    11/19/2022, 1:15 PM
    sounds like you want to combine hx-include and hx-push-url
  • e

    echoing-nest-31408

    11/19/2022, 1:17 PM
    Aha, I was using hx-include wrong
  • m

    mysterious-toddler-20573

    11/19/2022, 1:17 PM
    there are some big projects using htmx's predecessor, intercooler.js. @gray-oyster-51537 works at https://www.instawork.com/, and they have (or had) a really big intercooler app. So, they are out there, but no FAANG coverage yet. (I recently spoke at a FAANG, who is using it internally, so it's probably coming.)
  • m

    mysterious-toddler-20573

    11/19/2022, 1:43 PM
    I think that the docs for this extension should mention the
    Vary
    header and maybe link here: https://htmx.org/docs/#caching
  • m

    mysterious-toddler-20573

    11/19/2022, 1:43 PM
    and, by "I think", I mean...
  • e

    echoing-nest-31408

    11/19/2022, 1:44 PM
    Can I get hx-get to trigger when the form its div is inside changes?
  • m

    mysterious-toddler-20573

    11/19/2022, 1:44 PM
    hx-trigger="change from:#some-form-id"
  • e

    echoing-nest-31408

    11/19/2022, 1:45 PM
    Ah, too easy. Is that somewhere in the docs? I didn't see 'change' listed in hx-trigger, but I guess knowing that 'change' is an event and knowing about the from: option is enough.
  • m

    mysterious-toddler-20573

    11/19/2022, 1:46 PM
    yeah, change is just a generic DOM event
  • m

    mysterious-toddler-20573

    11/19/2022, 1:46 PM
    definitely worth perusing this: https://developer.mozilla.org/en-US/docs/Web/Events
  • b

    busy-tomato-43957

    11/19/2022, 6:48 PM
    I have a set of radio inputs with hx-post and hx-swap=none where the request returns some oob content. The idea is that the radio inputs just do their thing and the rest of the page responds with oob responses
  • b

    busy-tomato-43957

    11/19/2022, 6:49 PM
    The problem is that the radio inputs state is being reverted whenever one is clicked
  • b

    busy-tomato-43957

    11/19/2022, 6:50 PM
    So the request goes through, but the clicked radio input stays the same. With dev tools open I can see the checked=false status flash to true then back to false immediately
  • b

    busy-tomato-43957

    11/19/2022, 6:50 PM
    any ideas?
  • a

    ancient-father-3063

    11/19/2022, 11:47 PM
    Is it possible to include a name or some sort of identifier in my htmx get request?
  • a

    ancient-father-3063

    11/19/2022, 11:48 PM
    My problem is I'm using the same code on my backend to handle a htmx trigger from two different parts of my website.
  • a

    ancient-father-3063

    11/19/2022, 11:48 PM
    But they have to be handled slightly differently
  • a

    ancient-father-3063

    11/19/2022, 11:49 PM
    and I don't know how my backend can know which one comes from where
  • g

    gorgeous-airport-54386

    11/19/2022, 11:50 PM
    why not just have two different paths, or a query parameter?
  • a

    ancient-father-3063

    11/20/2022, 12:47 AM
    I could do two different paths, and that's what I've done for now. I just thought since they are both doing basically the same thing it would be nice to just have one. Could you explain what you mean by query parameter?
  • g

    gorgeous-airport-54386

    11/20/2022, 12:49 AM
    /url?thing=asdf
  • a

    ancient-father-3063

    11/20/2022, 12:50 AM
    ah yes that might be what I'm looking for, thanks for the idea
1...917918919...1146Latest