Skip to content

Conversation

@erikgaas
Copy link
Contributor

Adds a brief note before the HTMX section explaining that refreshing after a POST can cause "Resubmit form data?" prompts, and that Redirect('/') is the traditional fix (the Post/Redirect/Get pattern).

Also notes this isn't needed with HTMX since submissions happen via AJAX — which is a nice segue into why HTMX is useful.

Fixes #389

Explains that refreshing after POST can cause "resubmit form?" prompts,
and that Redirect('/') is the traditional fix. Notes this isn't needed
with HTMX since submissions happen via AJAX.

Fixes #389
@gitnotebooks
Copy link

gitnotebooks bot commented Dec 12, 2025

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/fasthtml/pull/812

@erikgaas erikgaas added the documentation Improvements or additions to documentation label Dec 12, 2025
@erikgaas erikgaas requested a review from jph00 December 17, 2025 03:34
@jph00
Copy link
Contributor

jph00 commented Dec 22, 2025

Thanks @erikgaas . Minor nit - but I'm not sure "ajax" is the best term here. That is specific to XMLHttpRequest requests, but nowadays most APIs, including the upcoming HTMX v4, use fetch.

@jph00 jph00 merged commit c74d292 into main Dec 22, 2025
0 of 2 checks passed
@jph00 jph00 deleted the erikgaas/fix-389 branch December 22, 2025 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FastHTML by Example should use a redirect for POST instead of render

3 participants