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

    great-article-50141

    05/26/2023, 4:54 PM
    Ok cool. I'll put up a blog post with a tutorial on it. If I asked very very nicely, would you be willing to do a quick review of it when I'm done before it goes public, just to make sure I haven't done anything stupid with the tutorial?
  • m

    miniature-lizard-24702

    05/26/2023, 5:00 PM
    the primeagen effect in the wild
  • m

    mysterious-toddler-20573

    05/26/2023, 5:02 PM
    And hn
  • m

    mysterious-toddler-20573

    05/26/2023, 5:02 PM
    Of course
  • m

    mysterious-toddler-20573

    05/26/2023, 5:02 PM
    https://twitter.com/htmx_org/status/1662141545913499652
  • n

    nice-cpu-16963

    05/26/2023, 8:30 PM
    Hi!
  • n

    nice-cpu-16963

    05/26/2023, 8:31 PM
    is there a way to make a table head behave like a form without wrapping the entire table in a form (since it's not possible to wrap on its own in a form)?
  • g

    great-cartoon-12331

    05/26/2023, 8:32 PM
    sure, you can have a form adjacent to the table and inputs inside the thead which are connected to the form
  • g

    great-cartoon-12331

    05/26/2023, 8:33 PM
    using https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#form
  • n

    nice-cpu-16963

    05/26/2023, 8:46 PM
    ohhhhhhh sweet ! thank you
  • n

    nice-cpu-16963

    05/26/2023, 8:46 PM
    that changes my life
  • f

    freezing-waitress-26396

    05/26/2023, 9:23 PM
    Sure! 🙏 Congrats!
  • g

    gray-dinner-25100

    05/27/2023, 12:03 AM
    I needed to use delay, hx-vals (w event.detail) also from:window and got error. same with -> https://github.com/bigskysoftware/htmx/issues/1189
  • g

    gray-dinner-25100

    05/27/2023, 12:04 AM
    throttle works ok
  • f

    fierce-fish-43125

    05/27/2023, 2:17 AM
    PR #1460 🙂
  • p

    powerful-army-90860

    05/27/2023, 6:11 AM
    Hey all. I have the following search form that I want to submit via HTMX as I'm going to add some extra inputs for filtering. When I add the hx-get and hx-trigger to the input the get is triggered within 500 ms. However, when I add this to the form it takes ages to trigger. What am I doing wrong?
    Copy code
    <form class="flex items-center"
      id="search-form"
      hx-get="{{bot.get_url_list_url}}"
      hx-trigger="change, keyup changed delay:500msfrom:#search"
      hx-target="#url-form"
      >
    <label for="search" class="sr-only">Search</label>
    <div>
       <input type="text"
          id="search"
          name="url__icontains"
          placeholder="Search" required="">
       </div>
    </form>
  • s

    shy-zebra-22292

    05/27/2023, 7:25 AM
    never tried this but...
    delay:500msfrom:#search
    is suspicious to me. Is it on purpose that there is no space between
    500ms
    and
    from...
    ? might it be that js does some weird evaluation of what a delay of value
    500msfrom:#search
    means? it might not be evaluated as 500ms anymore, that's my thought. there is a clear space divide in the example:
  • s

    shy-zebra-22292

    05/27/2023, 7:28 AM

    https://cdn.discordapp.com/attachments/725789747212976259/1111918722815361054/image.png▾

  • s

    shy-zebra-22292

    05/27/2023, 7:29 AM
    also I'd try to keep the
    hx-get
    and other attributes on the
    <form
    ... Since you have an "on change" listener on the form already I am pretty sure that the
    <input search
    change will bubble up to the
    <form
    so you might not need this part at all
    from:#search
    depending on circumstances.
  • f

    future-appointment-69775

    05/27/2023, 9:54 AM
    Hello does anyone encounter
    htmx:swapError
    before? I'm very confuse why this error occured
    Copy code
    html
                <tr>
                  <td colspan="3">
                    <div class="mt-5 py-12 px-4 bg-gray-50">
                      <div class="text-center">
                        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-12 h-12 mx-auto text-gray-400">
                          <path stroke-linecap="round" stroke-linejoin="round" d="M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" />
                        </svg>
                        <h3 class="text-gray-900 font-semibold text-sm mt-2">No {{ pluralize(type) }}</h3>
                        <p class="text-gray-500 text-sm mt-1">Get started by creating a new {{ type }}.</p>
    
                        <div class="mt-6">
                          <button
                            class="inline-block rounded border border-indigo-600 bg-indigo-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring active:text-indigo-500"
                            hx-get={{ createUrl }}
                            hx-target="closest tr"
                            hx-swap="outerHTML"
                          >
                            Add {{ type }}
                          </button>
                        </div>
                      </div>
                    </div>
                  </td>
                </tr>
  • f

    future-appointment-69775

    05/27/2023, 9:55 AM
    And theres other error on browser log

    https://cdn.discordapp.com/attachments/725789747212976259/1111955887410651236/image.png▾

  • f

    future-appointment-69775

    05/27/2023, 9:55 AM
    How I can debug this kind of issue?
  • p

    proud-librarian-99598

    05/27/2023, 10:04 AM
    Have you read https://htmx.org/docs/#debugging ?
  • f

    future-appointment-69775

    05/27/2023, 10:05 AM
    no I havent, thanks for pointing out
  • p

    proud-librarian-99598

    05/27/2023, 10:06 AM
    I am looking for a good example where
    hx-target
    using
    next
    ,
    previous
    or
    find
    are useful. Anybody that has used this in a demo or a real world application?
  • f

    future-appointment-69775

    05/27/2023, 10:17 AM
    I'm very confuse right now, what should expect on the log? Currently, I can see the target element I assume the implementation is correct

    https://cdn.discordapp.com/attachments/725789747212976259/1111961275887525929/image.png▾

    https://cdn.discordapp.com/attachments/725789747212976259/1111961276139188315/image.png▾

  • p

    powerful-army-90860

    05/27/2023, 10:20 AM
    No there is a space. That was a cut and paste error
  • r

    ripe-action-67367

    05/27/2023, 10:28 AM
    Could you provide a response example so that we can try to repro this?
  • g

    great-orange-45113

    05/27/2023, 12:26 PM
    Hi there, I'm using Django and have used this modal tutorial to get a modal to load, which works perfectly when the whole page is loaded for the first time. However, I reload the section of the page with this button on using a partial, and the button no longer works. I'm using simple-datatables https://github.com/fiduswriter/simple-datatables
  • f

    future-appointment-69775

    05/27/2023, 12:55 PM
    Ohhh I found the problem because of the response - thank you for pointing out
1...11421143114411451146Latest