Disable submit button after pressed, unless data changes

There’s probably a couple of ways to do this but I’m looking for the most efficient, preferred method.

I have a few forms and currently users will submit data and the workflow will save it to the database. But once they submit, the button stays intact. Despite an alert popping up, they can continue to submit the data and overflow the database with new instances of the form.

So, how can I disable the button to stop being clicked once an initial submission is done, and only release it if there is a change to one of the fields on the page?

Hi there! You’d be right in your assumption that there are multiple ways of doing this. One way to accomplish this would be to have a couple of custom states on your submit button something along the lines of “Last edited” and “Last submitted”. You would then set the Last submitted state to the current time on submission, and then create an event for each form input using “When input’s value has changed” that set’s the Last edited state to the current time. That way you could place a conditional on your submit button disabling it whenever Last submit is more recent than the last edited time!

Like you said this is just one way to accomplish this, but hopefully this method either works for you or sparks some ideas!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.