bigskysoftware / bigskysoftware/htmx

Using button instead of input[type=submit] prevents sub-sequent submission

Open
#3,587 0 comments 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

When using `Submit` instead of ``, after initial form submission, subsequent submissions are ignored.

I have a form that appends a table to bottom of page after the form is submitted. On first click of button, it works as expected. When I attempt to submit the form again, nothing happens. Repeatable infinitely.

After looking in htmx.js, I saw some code that looked specifically for input[type=submit], so I thought maybe it would work if I used an input instead of a button. I was correct. If I replace the button with a submit input, it works as expected.

The strange part is that another `` on the page/form still worked, only the one that was submitted fails to work after the first submission. I did verify that the affected `` still existed on the page and hadn't changed.

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.