Submit button behaviour


Well-known member
I may have imagined this, but I've noticed that when you click on a submit button, perhaps to save a page, the button disables so you cannot press it until the action is completed (page changes / reloads).

One example of this is the when you save a Template Modification. Here, when you save, the button disables, just prior to taking you back to the Template Modification list.

It also happens when submitting things such as posts.

How is this determined? (Maybe it's just a browser response?)
Last edited:

Chris D

XenForo developer
Staff member
If I recall, it happens automatically when forms are submitted with AJAX.

But failing that add the class DisableOnSubmit to the button.


Well-known member
How might I go about the achieving two things, one after the other: a reponseView and a responseRedirect? I have an overlay which, when submitted, should return the responseView, and redirect to the same page.

I had thought this would happen if I included data-redirect="on" when building the form, and including a responseRedirect, but how I currently have things set-up, only one is returned. I have tried using a hidden "redirect" input in the form.

This is within the if ($this->isConfirmedPost()), similar to when selecting multiple threads and choosing to delete them: for me, I'm trying to do a responseView (output something), then redirect to current page.