How can i send form by type into input using htmx?

I have a search input and sort select. I wrapped it into form. How can i send form by typing into search input (hx-trigger="keyup changed delay:150ms") or selecting another item in select (hx-trigger="changed"). I need to send data from both of this elements. Here is my code: <form hx-get="{% url ‘search-spec’ %}" hx-target="#search-results" hx-trigger="keyup delay:150ms… Read More How can i send form by type into input using htmx?

How to call HTMX in a single html page

I’m new to HTMX and I have made this sample: <!DOCTYPE html> <html> <head> </head> <body> <script src="https://unpkg.com/htmx.org@1.8.4&quot; integrity="sha384-wg5Y/JwF7VxGk4zLsJEcAojRtlVp1FKKdGy1qN+OMtdq72WRvX/EdRdqg/LOhYeV" crossorigin="anonymous"></script> <form> <button hx-get="https://google.com/">Click Me!</button> </form> </body> </html> So I tried loading the htmx script firstly and then used hx-get to make a GET request for button. But now the problem is, it does not work… Read More How to call HTMX in a single html page

htmx and django: return HX-Trigger header with json data show error `SyntaxError: JSON.parse…`

I’m following the examples in https://htmx.org/headers/hx-trigger/ my view def my_view(request): res = render(request, ‘index.html’) res.headers["HX-Trigger"] = … return res this code works res.headers["HX-Trigger"] = "showMessage" while below code will cause error SyntaxError: JSON.parse: expected property name or ‘}’ at line 1 column 2 of the JSON data res.headers["HX-Trigger"] = {"showMessage": "Here Is A Message"} What… Read More htmx and django: return HX-Trigger header with json data show error `SyntaxError: JSON.parse…`

File not in request.FILES but in request.POST I'm using htmx to make post request

I have snippet of inputs that I render to the html page when a condition is met, everythings works appropriately except for the input with type file, I want to upload the files when a change has occured but the file object is not in request.FILES, it’s in request.POST now I don’t mind it being… Read More File not in request.FILES but in request.POST I'm using htmx to make post request