1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Submit button behaviour

Discussion in 'XenForo Development Discussions' started by Valhalla, Jun 1, 2014.

  1. Valhalla

    Valhalla 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: Jun 1, 2014
  2. Chris D

    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.
    Valhalla likes this.
  3. Valhalla

    Valhalla 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.

Share This Page