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

    ripe-action-67367

    09/07/2022, 11:04 AM
    Try setting
    hx-target="#modal" hx-select="#modal" hx-swap="outerHTML"
    on the save button
  • d

    dry-pharmacist-51808

    09/07/2022, 11:54 AM
    Makes sense! Thanks for sharing and responding in kind!
  • s

    stocky-dentist-80693

    09/07/2022, 11:56 AM
    No problem πŸ™‚
  • h

    hundreds-dusk-97323

    09/07/2022, 1:10 PM
    @ripe-action-67367 that work fine πŸ˜„ thx a lot
  • b

    billions-architect-49743

    09/07/2022, 2:10 PM
    Is there a way with HTMX to have an "outer" element control the "inner" elements?
    Copy code
    <div hx-get="/demo/">
        <select>...</select>
    <div>
    In the example above, I'd like the select to trigger a hx-get, but set the attribute via the div. The reason, is I am using django, and I can conveniently render form fields, but I can't easily attach attributes to it.
  • s

    stocky-dentist-80693

    09/07/2022, 2:23 PM
    You should be able to add
    hx-trigger="change from:find select"
    to the so it's trigger on a change from the
  • b

    bumpy-cricket-7187

    09/07/2022, 2:27 PM
    hello everyone, are there any guidlines regarding minimal browser features for htmx to work properly? Trying to run htmx page on ancient smart tv and cannot get it to work. I see in the server logs that all resources are downloaded and it even installs WS connection, but content of the page is not updating afterwards. Even worse is that I cannot get error logs from device.
  • b

    billions-architect-49743

    09/07/2022, 2:34 PM
    @stocky-dentist-80693 Exactly what I needed. Thanks a bunch.
  • b

    bland-coat-6833

    09/07/2022, 2:48 PM
    Can you see the user-agent in the server logs? Might give you an idea about what you’re dealing with.
  • b

    bumpy-cricket-7187

    09/07/2022, 2:50 PM
    yes I do
  • b

    bumpy-cricket-7187

    09/07/2022, 3:00 PM
    I tried two different TV's and had no success unfortunately, so I figured I will ask here first before I dive in
  • b

    bland-coat-6833

    09/07/2022, 3:04 PM
    Might be worth putting a simple vanilla JS script at the bottom of your page? Something that does a
    document.write
    or similar just to see if you can edit the DOM. Then maybe do a
    fetch
    to your server and see if that works?
  • b

    bland-coat-6833

    09/07/2022, 3:07 PM
    Otherwise someone else will have to have a stab at a required features list πŸ˜„
  • a

    ancient-shoe-86801

    09/07/2022, 5:08 PM
    this seems useful for event based programming: https://davidwalsh.name/monitorevents
  • m

    mysterious-toddler-20573

    09/07/2022, 6:06 PM
    extremely useful!
  • m

    mysterious-toddler-20573

    09/07/2022, 6:06 PM
    mentioned in the debugging section of the htmx docs: https://htmx.org/docs/#debugging
  • a

    acceptable-cpu-11229

    09/07/2022, 6:09 PM
    Heya. Quick question: doing
    hx-post
    call. The data I get back is an
    octet-stream
    . How do I start to download it instead of returning it as a string being injected into an element?
  • m

    mysterious-toddler-20573

    09/07/2022, 6:10 PM
    you shouldn't use an ajax request for that, I usually issue a client side redirect to the URL that downloads the file
  • m

    mysterious-toddler-20573

    09/07/2022, 6:11 PM
    looks like there is a way to do it in ajax, but htmx doesn't handle blobs currently: https://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax
  • a

    acceptable-cpu-11229

    09/07/2022, 6:11 PM
    Okay, thought that too... Well, will use
    HX-Redirect
    then, with a formed link. The trouble is that server that sends data back to be, sends it as
    octet-stream
    , and there is no file formed. But that's not an htmx issue ofc xD
  • m

    mysterious-toddler-20573

    09/07/2022, 6:12 PM
    You could maybe write a swap extension to deal with this
  • a

    acceptable-cpu-11229

    09/07/2022, 6:12 PM
    Yup, digged that one, but came to conclusion that it would be better to do it 'the right way' =)) And the right one (and easier) is to accept the link and just redirect to that link.
  • m

    mysterious-toddler-20573

    09/07/2022, 6:12 PM
    simple good mmm grug say
  • a

    acceptable-cpu-11229

    09/07/2022, 6:13 PM
    lol
  • a

    acceptable-cpu-11229

    09/07/2022, 6:13 PM
    Glad to see you're on DIscord. Last time it was gitter and intercooler πŸ˜„ Cheers.
  • f

    fierce-soccer-7824

    09/08/2022, 12:01 AM
    Hello guys, I would like to trigger the same script with 2 events : on load & on htmx:afterOnLoad, how can I do that ? is there any syntax that allows you to chain events like "on click or mouseenter log 10"
  • b

    bumpy-cricket-7187

    09/08/2022, 5:55 AM
    That is what I'm doing today, thanks for pointers. I'm more of a backend person and wanted to avoid js at al costs by using htmx, but will have to get my hands dirty.
  • s

    salmon-xylophone-28580

    09/08/2022, 10:27 AM
    A big thank you to Carson for advertising hypertext-driven-webdevelopment. We just had a meeting where we thought how implement something. Vuejs? ... maybe htmx? .... And then: html+http is enough. In this case we even decided to not use htmx. Just plain and boring and old html-forms are enough. No need for AJAX or json-APIs. Thank you all for keeping things simple!
  • b

    blue-ghost-19146

    09/08/2022, 11:20 AM
    Hi all, I have a form which needs to be submitted whenever a checkbox is changed (appears as a toggle control).
    checkbox.checked
    is altered by a JS function, but only checking/unchecking the checkbox manually seems to activate the
    hx-trigger="change from:#checkbox-id"
    . Any guidance would be appreciated πŸ™
  • f

    flat-painting-36912

    09/08/2022, 11:42 AM
    Hey everyone, just started exploring HTMX for a new project at work. I'd like to know if the following is a use case for HTMX. Basically when I show a toast (https://daisyui.com/components/toast/), I'd want the toast to fade out after, say, 3-5 seconds. Is this a good use case for HTMX?
1...820821822...1146Latest