Hotwire Discussion

Re-enabling submit button after user navigates back

I’m using data-disable-with (which I assume uses Rails UJS) to disable a submit button on form submission. If a user navigates back to the form after submission though, it reloads with the button in the disabled state.

Does anyone have an elegant way to either restore the original value, or even replace the UJS behaviour completely to achieve disabling conveniently, whilst preserving proper back button functionality.

What type of method is the form using? POST, GET, etc?

The form is using a POST.

I have the same issue.

I’m not using UJS, so I’m unable to give advice, but you may be interested in: