htmx Questions

3

Solved

I'm trying to set up a short-lived event stream handler using htmx. Imagine, e.g., streaming a chatgpt response or similar. The stream will last for 10-30 seconds and then I expect it to be exhaust...
Runck asked 30/10, 2023 at 8:28

3

Solved

HTMX is great and using AJAX for most of the stuff is awesome! But from time to time I just need a real "phyiscal" redirect to another page. Any ideas how to achieve this without starting...
Deil asked 7/1, 2022 at 7:59

5

Solved

I have a page containing several forms. If a user submits a form, then only the current form should get submitted (not the other forms of the page). On the server the form gets validated. Case 1: I...
Eliott asked 4/1, 2021 at 20:53

7

Solved

I'm currently building a website with django and htmx and i like the combination so far. Let's say I use an htmx attribute on a button to replace a div in the DOM with another div that is supposed ...
Midtown asked 17/8, 2022 at 13:18

2

Solved

In one of my pages I have a select element and a form. What I want to achieve is to update the field values ​​in the form when the select changes, which happens successfully. I did many tests and r...
Chartism asked 8/7 at 22:36

4

I am using htmx to add some AJAX calls to my page. I have a cart-count element that is defined to retrieve the number of items in the cart 1s after the page is loaded: <span id="cart-count&...
Electroform asked 24/1, 2021 at 23:16

2

I need to trigger to fire an ajax call on clicking enter key. I tried using <form class="align-items-center row" th:action="@{/addTask}" method="post" th:object=&q...
Yurikoyursa asked 19/6, 2023 at 18:31

3

I'm using HTMX and I have a button inside a form that says 'Send' and when the form is submitted a loading spinner appears next to it. I want the 'Send' to disappear and only the loading spinner to...
Arvonio asked 26/10, 2022 at 17:33

2

Solved

I have a form with multiple select elements where the available choices of some are dependent on the chosen value in others. I'm using HTMX to achieve this. For one element, I also want to dynamica...
Mcrae asked 9/9, 2022 at 7:1

5

Solved

This works, the way I want it: If the <select> gets changed, then htmx gets triggered. <script src="https://unpkg.com/[email protected]"></script> <table> <tr ...
Flora asked 10/1, 2021 at 20:57

4

Solved

I have a button which opens a dialog located in some_template.html: <button @click="open = !open" id="btn_id" hx-get="/some_url/" hx-trigger="click" h...
Stretchy asked 4/8, 2023 at 15:50

2

Solved

I use htmx together with the Django forms library. Here is my template: <table> <tr hx-post="{{ object.get_absolute_url }}" hx-swap="outerHTML" hx-trigger="chan...
Diclinous asked 10/1, 2021 at 16:18

4

Solved

Let's say my user needs to be able to get back to a certain location in the app. For example we'll say a tab. The htmx attribute hx-push-url allows me to update the URL in the bar when they click t...
Gerigerianna asked 26/5, 2023 at 16:14

2

I have following htmx code <button hx-get="/views/users/byId/someId" hx-target=".details">Details</button> <div class="details">first</div> &...
Departmentalism asked 11/6, 2023 at 17:41

5

I'm using HTMX and would like to have a <select> form field that automatically loads a specific URL into a <div>. The "value select" example is similar to this idea, but it in...
Mariner asked 20/6, 2021 at 1:44

1

Solved

I have a login form marked up like this: <div id="login_form" hx-ext="response-targets"> <form action="/login" method="POST" hx-boost="true&qu...
Jeffery asked 4/10, 2023 at 7:25

4

Solved

I'm writing a simple website with Django and I decided to try htmx library in client side to load html fragments. Now I want to sort lists by different fields, ascending and descending. I have some...
Franchot asked 6/12, 2021 at 16:0

2

Solved

With HTMX I know I can poll e.g. "/news" every 2 seconds like this: <div hx-get="/news" hx-trigger="every 2s">div> But it takes 2s before the is triggered th...
Unaffected asked 3/12, 2021 at 15:25

5

<form class="" id="form" hx-post="/add/" hx-swap="afterbegin" hx-target="#big_list" hx-trigger="submit"> <input type="te...
Octal asked 28/9, 2021 at 15:9

2

Solved

I'm making a form with a nested dynamic formset using htmx i (want to evade usign JS, but if there's no choice...) to instance more formset fields in order to make a dynamic nested form, however wh...
Tymes asked 10/12, 2022 at 23:10

3

Solved

I am creating a very basic Django messaging application, and would like to use htmx to send and render messages. I am able to post, save the message, and render the partial message without issue. H...
Ramose asked 20/11, 2021 at 4:23

1

Solved

I'm fairly new to htmx and django. I can implement htmx through function-based views OK, as I just call the function and return a partial.html file into the page. However I don't understand how to ...
Mandelbaum asked 8/7, 2023 at 11:19

2

How to submit a form using submit button or input type submit outside of the form? In HTML It can be done easily using form ID but I didn't find the way to submit the form outside of the form in HT...
Hagans asked 26/2, 2022 at 14:58

1

Solved

I'm trying to redirect on the frontend after a login. I make a request from my htmx frontend like this <form hx-post="/authenticate" hx-target= "#success" id="login-form...
Vitriform asked 3/1, 2023 at 11:30

0

I am really interested in bringing the productivity of htmx to when I write mobile apps. Anyone have experience with using htmx in Ionic or Cordova? Any feedback from app store?
Terrel asked 26/7, 2022 at 10:40

© 2022 - 2024 — McMap. All rights reserved.