How can I not disable submit after a submission

25 views
Skip to first unread message

Linell Bonnette

unread,
Oct 9, 2016, 7:27:23 PM10/9/16
to SimpleForm
I've got code that looks like this gist. It works perfectly! But, once I've submitted the form the save button becomes disabled. I'd like to be able to continue clicking it. How can I disable the disabling of the button?

Ben Trewern

unread,
Sep 5, 2018, 6:21:16 AM9/5/18
to SimpleForm
I know this is old (and the gist is gone) but I had a similar issue and used:

<%= f.button :submit, 'Save', data: { disable_with: false } %>

which fixed the problem.

John Athayde

unread,
Sep 5, 2018, 7:06:36 AM9/5/18
to plataformate...@googlegroups.com
You can also have it change the text:

<%= f.button :submit,
class: 'button button-primary',
data: { disable_with: "Please wait..." } %>

Cheers,
J

John Athayde
ath...@gmail.com
> --
> You received this message because you are subscribed to the Google Groups "SimpleForm" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-simp...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages