https://htmx.org logo
Join Discord
Powered by
# πŸ”₯-django-htmx
  • r

    rich-television-50179

    01/05/2023, 8:33 PM
    That's awesome! I unfortunately don't use Meetup.com or sites like that.
  • a

    average-fireman-41481

    01/05/2023, 8:35 PM
    Thank you I built it when I became aware of this issue while volunteering at Code and Coffee, where we were dealing with over 20 meetup groups across the US, each with their own iCalendar feed. It was a real hassle trying to keep track of all of the events.
  • r

    rich-television-50179

    01/05/2023, 8:36 PM
    I love the dedication and problem solving! If I used those sites, I'd try out your app.
  • a

    average-fireman-41481

    01/05/2023, 8:44 PM
    Thanks man! Just to bring out the point it's not specific to those sites and can be used on any calendar feed including google calendars
  • s

    some-solstice-89459

    01/07/2023, 3:19 AM
    hello guys, this is a project that I did based on the trello example in the htmx page, made for me to see how far I could go in ui building using mostly htmx, I ended up liking the result so I will share it with you, there is many things that I need to improve ( especially in code refactoring), so any feedback will be appreciated https://github.com/LuanBrt/trello_clone
  • w

    witty-daybreak-45092

    01/08/2023, 6:01 PM
    So I have a thing that I can't find the reasoning for and it's driving me nuts. With HTMX enabled, navigation to any new page (that is longer than the viewport) automatically scrolls to below the navbar. Does anyone know why it does that and how to stop that from happening? Links in thread
    l
    • 2
    • 5
  • l

    lemon-battery-11524

    01/08/2023, 10:11 PM
    how do I make htmx ignore the element that triggered the request when doing oob swap? I've got a button that sends a request to the view that returns the same button or oob toast message if user is not authenticated, but when doing the oob swap the original button is disappearing
  • s

    some-solstice-89459

    01/08/2023, 11:15 PM
    I think hx-preserve don't work when you are doing oob swaps
  • s

    some-solstice-89459

    01/08/2023, 11:16 PM
    maybe you can change the returned html to always include the button
  • l

    limited-potato-46306

    01/09/2023, 1:11 AM
    In cases where you only want to OOB swap, set the
    HX-Reswap
    response header to β€œnone”. This header will ignore the regular content and just do the OOB swap. So in your case, when the user is not authenticated, use the response header.
  • l

    lemon-battery-11524

    01/09/2023, 8:24 AM
    thank you, this did the trick
  • b

    breezy-wolf-33397

    01/09/2023, 11:31 AM
    Hello friends. I am pretty new to Django, and found the nature of HTMX appealing for a python developer without any frontend experience. I don't have a specific problem, but I would like to hear your take on best practice as it pertains to making dynamic forms persistent across the site/reloads. The specific forms are meant for tracking a workout, and thus the end user will start off with some program generated by a coach, and creating and persisting this form is trivial in Django of course, as we just create the form from the database each time. However when the end user wants to add sets or exercise to the form dynamically, I feel like my choices would either be to update the program in the database each time it is changed, this option however seems like it would impact performance of the app a lot (I am new to web development in general, so please correct this assumption if incorrect). Alternatively I could store the input from the user in local or session storage, and somehow rebuild the form on reload from that data, only submitting to the database at some interval/at the end of the session. I hope this question is appropriate, ty in advance!
    r
    • 2
    • 3
  • r

    rich-television-50179

    01/09/2023, 12:09 PM
    Hello friends I am pretty new to Django
  • r

    rich-television-50179

    01/09/2023, 2:58 PM
    Probably a dumb question, but is htmx useful for Django user login forms?
  • s

    some-solstice-89459

    01/09/2023, 3:11 PM
    I used htmx in the register form to show errors to the user before the form is submitted, doing a request when an input is changed, and swapping the errors to a div
  • s

    some-solstice-89459

    01/09/2023, 3:12 PM
    but for login I dont know if something like that is usefull
  • r

    rich-television-50179

    01/09/2023, 3:12 PM
    That's what I was kind of thinking as well. Thank you.
  • c

    colossal-laptop-66232

    01/13/2023, 10:59 AM
    Hi all. Need help πŸ™‚ I want to trigger htmx request after a form filled completely. How to do it? Example:
    Copy code
    <form action="" method="get">
        <input type="text" name="Name" id="name">
        <input type="text" name="Age" id="age">
        <input type="text" name="City" id="city">
    </form>
        <button type="submit" disabled>Click!</button>
    When the form is openned - submit is disabled, and it should change its state to active only after all form fields are filled.
  • r

    rich-television-50179

    01/13/2023, 12:05 PM
    You'd probably want to write some JS to handle that.
  • r

    rich-television-50179

    01/13/2023, 12:09 PM
    Or remove the disabled attribute and put
    required
    on each input like below:
    Copy code
    html
    <form action="" method="get">
        <input type="text" name="Name" id="name" required>
        <input type="text" name="Age" id="age" required>
        <input type="text" name="City" id="city" required>
        <button type="submit">Click!</button>
    </form>
  • c

    colossal-laptop-66232

    01/13/2023, 12:24 PM
    Thanks for the advice! But the main idea is show up the button only after all fields were filled. Will search for js solution.
  • b

    boundless-vase-80440

    01/13/2023, 1:29 PM
    Maybe you can use the inline form validation pattern described here: https://htmx.org/examples/inline-validation/
  • m

    mysterious-toddler-20573

    01/14/2023, 12:36 AM
    https://www.reddit.com/r/django/comments/10b0uxs/what_is_so_great_about_htmx/
  • m

    mammoth-family-48524

    01/14/2023, 8:01 AM
    If you haven’t already seen it, this would be fairly straightforward with alpinejs
  • g

    great-cartoon-12331

    01/14/2023, 5:40 PM
    why not do it with normal HTML form validation? it will show error prompts and not allow the form to submit if all required fields are not filled.
  • m

    miniature-lizard-24702

    01/15/2023, 7:51 PM
    has anyone in the django community ever built something like (https://editorjs.io/) in HTMX?
  • b

    bitter-monkey-50309

    01/15/2023, 11:54 PM
    I don't think something like that is suitable for htmx, or even possible... High fidelity interactions need proper Javascript, not a lot of getting around that IMO
  • s

    some-solstice-89459

    01/16/2023, 12:02 AM
    yeah, certains things are best done when using javascript, but with the assist of something like django-ckeditor, you could get the functionality of rich text, without writing js
  • r

    ripe-ghost-5606

    01/16/2023, 12:11 AM
    Refusing to write any JS is a bit silly. Sometimes writing a few lines yourself is better than adding in a third party library (which is just wrapping js for you) that you'll use 5% of or that is poorly maintained
  • m

    miniature-lizard-24702

    01/16/2023, 12:53 AM
    I was afraid you guys would say that. I’ll probably just suck it up and use editorjs then.
1...888990...100Latest