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

    late-king-98305

    07/24/2022, 8:23 PM
    What are your initial thoughts? I'm struggling to come up with a scenario where it could help (at least as it pertains to htmx).
  • m

    mysterious-toddler-20573

    07/24/2022, 8:24 PM
    I'm wondering if something like a Content-Range header with a unit of
    css
    might be able to replace out of band swaps in a more HTTP-centric manner: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range
  • m

    mysterious-toddler-20573

    07/24/2022, 8:25 PM
    could be a complete disaster if browsers already look at that stuff, not sure
  • l

    late-king-98305

    07/24/2022, 8:26 PM
    OK - I'll be pondering...
  • m

    mysterious-toddler-20573

    07/24/2022, 8:29 PM
    this all may be a terrible idea, just noticed it
  • m

    mysterious-toddler-20573

    07/24/2022, 8:30 PM
    and have to admit oob swaps, while insanely useful, felt "outside the lines"
  • b

    brainy-ice-92385

    07/24/2022, 10:00 PM
    Just to note, if you implement something like this then server-side, every stack will need to implement that correct document format. The contrast highlights something very cool about the current oob swap syntax: it's just composed HTML, and everyone's servers are already really good at composing HTML
  • b

    brainy-ice-92385

    07/24/2022, 10:03 PM
    Not sure I understand what you mean by "with a unit of `css`"
  • m

    mysterious-toddler-20573

    07/24/2022, 10:03 PM
    that makes two of us!
  • m

    mysterious-toddler-20573

    07/24/2022, 10:04 PM
    this is all still in extreme speculation mode, here, take this: https://www.peterson.ie/
  • j

    jolly-kite-167

    07/24/2022, 11:41 PM
    ceci n'est pas un pipe
  • m

    mammoth-chef-10742

    07/25/2022, 12:23 PM
    Greetings htmx'ers, I'm new to htmx and still trying to understand it. As a result, I put together a small set of examples to try to figure it out. Perhaps some of you might benefit from taking a look. The url is: https://nadineloveshenry.com/htmx Best wishes, Henry Laxen
  • a

    ancient-father-3063

    07/25/2022, 12:26 PM
    So I have a formset of 5 forms on my website. I want one button, on click, to take the value from the form the user just changed and use that to do a htmx thing.
  • a

    ancient-father-3063

    07/25/2022, 12:27 PM
    I was thinking I could use hyperscript or htmx to, upon change of these form fields, put the field's value into the button.
  • a

    ancient-father-3063

    07/25/2022, 12:27 PM
    Because I don't think there's a way to tell the button to look for "the most recently modified form field" or something like that.
  • a

    ancient-father-3063

    07/25/2022, 12:28 PM
    so if every field has "when this changes change that button's variable to this field's form value". They would constantly overwrite each other but that's actually desirable because I want the button to only check the most recent one.
  • a

    ancient-father-3063

    07/25/2022, 12:28 PM
    Does this make sense? Can you think of a better way?
  • r

    ripe-action-67367

    07/25/2022, 12:30 PM
    That's something that would require some custom scripting in one way or another. The solution you describe sounds very reasonable to me
  • g

    gray-ocean-77409

    07/25/2022, 1:06 PM
    possibly dumb question: is it possible to pause the request in
    htmx:configRequest
    and start it later? There's something asynchronous I'd like to put in there (another request)
  • m

    mysterious-toddler-20573

    07/25/2022, 1:16 PM
    not currently, but there should be
  • m

    mysterious-toddler-20573

    07/25/2022, 1:20 PM
    re: Range header https://twitter.com/asbjornu/status/1551514401064247296
  • g

    gray-ocean-77409

    07/25/2022, 1:44 PM
    hmm nothing that fancy, i think... basically i want to make a request to a separate endpoint to put something in the header right before the request. The use case is a static website (jekyll) with a backend API -- I want to make a request to a separate endpoint to set a CSRF cookie, and then take it out of the cookie to put in a header for the 2nd request. I should be able to do the first request way earlier (e.g. on page load) but I was wondering if there's a way to just sequence those two requests in an extension or something
  • m

    mysterious-toddler-20573

    07/25/2022, 1:48 PM
    I would make the request in javascript (or whatever) and then trigger a custom event for htmx to issue the request once the CSRF is created
  • g

    gray-ocean-77409

    07/25/2022, 1:50 PM
    ok thanks sounds like that might work... sorry, i just started playing around with htmx today -- would
    hx-sync
    be helpful for this kind of thing?
  • m

    mysterious-toddler-20573

    07/25/2022, 2:07 PM
    mmm, probably not, that's to synchronize requests between multiple htmx-powered elements
  • a

    ancient-father-3063

    07/25/2022, 2:09 PM
    how do I include the element's value on an hx-get trigger?
  • m

    mysterious-toddler-20573

    07/25/2022, 2:10 PM
    Is it an input?
  • a

    ancient-father-3063

    07/25/2022, 2:22 PM
    Copy code
    html
    <button type="button" class="btn btn-info" id="namebutton" value="xxx" hx-trigger="click" hx-get="testget" hx-include="value">Check Name: </button>
  • a

    ancient-father-3063

    07/25/2022, 2:22 PM
    uh, no just a button
  • a

    ancient-father-3063

    07/25/2022, 2:25 PM
    or you remember me from the hyperscript question. I just need hyperscript to put that value somewhere and htmx to include it when the button is clicked
1...762763764...1146Latest