Replies: 1 comment
-
|
I think what is happening to you here is that htmx defaults to pushing the responseURL returned by the backend after the request and uses this to push into the URL. This url should have the query parameters and work fine but this responseURL could be set to not return properly from your backend or it could be blocked by something and in this case it falls back to the request url but it actually uses the url from before the query paremeters were set i think. So i would check what responseURL your browser is seeing with the request in browser dev tools. You could add hx-push-url="true" to your boosted element and I think this will override the boosted push fallback code that is causing your issue. I think htmx 4 has improved handling for this case already. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For example, if I have this page:
If Javascript is disabled, and you enter some text in the fields and click the "Preview" button, the browser's native behavior is to navigate to a URL like
http://localhost:8000/preview?title=sometitle&content=somecontent. I was expecting HTMX to mirror that, treating the form GET like a boosted<a>link.However, when I test it it seems like it it's making an AJAX call to
preview?title=sometitle&content=somecontentbut not adding query parameters to the URL bar.Is this a bug? Intended behavior? Is there something I'm misunderstanding about how HTMX deals with forms? Should I be setting
hx-boost="false"on the preview button?Beta Was this translation helpful? Give feedback.
All reactions