# Re-enabling submit button after user navigates back

**URL:** <https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503>\
**Category:** General\
**Created:** [November 22, 2021, 6:22pm UTC](https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503 "2021-11-22T18:22:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mbl77](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/mbl77/32/2373_2.png) [@mbl77](https://discuss.hotwired.dev/u/mbl77)\
**Post date:** [November 22, 2021, 6:22pm UTC](https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503/1 "2021-11-22T18:22:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tleish](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/tleish/32/920_2.png) [@tleish](https://discuss.hotwired.dev/u/tleish)\
**Post date:** [November 22, 2021, 6:28pm UTC](https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503/2 "2021-11-22T18:28:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mbl77](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/mbl77/32/2373_2.png) [@mbl77](https://discuss.hotwired.dev/u/mbl77)\
**Post date:** [November 22, 2021, 6:52pm UTC](https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503/3 "2021-11-22T18:52:32Z")

</div>

The form is using a POST.

---

<div class="post-metadata">

**Author:** ![Alec](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/alec/32/2324_2.png) [@Alec](https://discuss.hotwired.dev/u/Alec)\
**Post date:** [November 23, 2021, 2:44pm UTC](https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503/4 "2021-11-23T14:44:51Z")

</div>

I have the same issue.

---

<div class="post-metadata">

**Author:** ![tleish](https://yyz1.discourse-cdn.com/flex027/user_avatar/discuss.hotwired.dev/tleish/32/920_2.png) [@tleish](https://discuss.hotwired.dev/u/tleish)\
**Post date:** [November 24, 2021, 5:56am UTC](https://discuss.hotwired.dev/t/re-enabling-submit-button-after-user-navigates-back/3503/5 "2021-11-24T05:56:21Z")

</div>

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

- [data-disable-with · Issue #37 · hotwired/turbo-rails · GitHub](https://github.com/hotwired/turbo-rails/issues/37)
- [Double click protection with data-disable · Issue #55 · hotwired/turbo · GitHub](https://github.com/hotwired/turbo/issues/55)
