Using hx-disabled-elt on form associated/external submit button #3653
Unanswered
BregtDeLange
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to disable a submit button when a request is in flight. My submit button is outside the form, but I associate it with the "form" attribute.
However, the hx-disabled-elt doesn't add the disabled attribute when the request is happening. I understand that this button is not technically part of the form yet it is associated with it. I can add hx-disabled-elt to the form and use an id to make sure they're connected
But that feels a bit verbose as I might have several submit buttons for the same button.
I tried a script as well but feels too much hacking into the request flow
So I'm a bit unsure what approach I take best here. What are my options?
Beta Was this translation helpful? Give feedback.
All reactions