bigskysoftware / bigskysoftware/htmx

hx-get not sending form data

Open
#2,794 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

According to the docs, it suggests that `hx-params="*"` is a default setting
[](https://htmx.org/attributes/hx-params/)

The example shows:

`

Get Some HTML, Including Params
`
> This div will include all the parameters that a POST would, but they will be URL encoded and included in the URL, as per usual with a GET.

`hx-get` doesn't work this way, it only sends variables when explicitly stated on the tag itself and doesn't look for the closest form.
The HTMX code below shows that it skips this for a GET.

Screenshot 2024-08-06 at 01 10 34

It seems to me that you'd want it to process the form the same way as the other requests do (as the docs suggest), in the spirit of HTMX which is making the HTTP more generic across all tags and verbs.
There are cases where you want to call a GET from a form submission to make cacheing easier.
There is a workaround by using `hx-include="form"`, but that seems a bit unintuitive
`

Get Some HTML, Including Params
`

Is this intentional? Is there something I'm missing?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.