bigskysoftware / bigskysoftware/htmx

Non HX form submit (POST) are pushing URL into history preventing Form resubmission (htmx4)

Open
#4,059 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

I'm unsure if this is intended behavior or a bug. When HTMX is loaded on the page and I submit a standard form (method=POST) (without any HTMX attributes), refreshing the browser issues a GET request instead of resubmitting the POST request.

No PRG pattern (Post/Redirect/Get) is used.

In this case the form is submitted by JavaScript calling form.submit();

This can be fixed by adding

But as I said, the request is not performed by HTMX.

Contributor guide

Open the contributing guide

Research direction

Start with a minimal page containing a standard method=POST form, htmx loaded, and a JavaScript form.submit() call; compare its history behavior with and without the htmx-config setting history:false. Trace how the history setting affects non-HTMX submissions, then verify that a normal POST remains resubmittable on refresh without changing HTMX form behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.