bigskysoftware / bigskysoftware/htmx
Only enable swap for hx-target-error
Open
- Dominant language
- JavaScript
- Stars
- 49.4k
- Forks
- 1.7k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 30
Description
I want a form like this:
```
Submit
```
On submit, `path-deps` catches the patch to `/endpoint` and refreshes the related content. So a successful submission should use `hx-swap="none"`. However, that prevents `hx-target-error` from making the error swap so the user can correct the validation mistake.
So I have to do manually hide the response like this or with templating:
```
Submit
```
I cannot find a way to only enable swap for `hx-target-error`. It would be helpful if there was a way to only enable swap for error responses - or something that achieves the same effect.
Thanks!
Contributor guide
Assessment
This issue has not been assessed yet.