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

Show template in overlay after form submit.

Discussion in 'XenForo Development Discussions' started by mjda, Mar 8, 2014.

  1. mjda

    mjda Active Member

    I'm trying to build a form that members can submit data to which will be calculated and return some results back to them. I don't want them to have to go to a new page, though, to view the results. I'd rather just have the results given to them from a template in an overlay. However, when I do this:

    return $this->responseView('Addon_ViewPublic_Index''addon_results_template'$viewParams);
    I just get a message that says "Unspecified Error" and nothing else happens. Is there a class, or something, that I'm missing to make this work?

    Any help would be greatly appreciated.
  2. mjda

    mjda Active Member

    Surely someone on here can help me with this, right? :cautious:
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Can you check in the browser console to see if there is an error message?

    Have you confirmed that you can load the template manually without error?
  4. mjda

    mjda Active Member

    I don't see any kind of errors in there, but I'm not very familiar with using it. In fact, that's the first time I've ever even looked at my browser's javascript console. All it says, after I click the form submit button, is "Event: AutoValidationDataReceived", then "amount: Okay", then "Event: AutoValidationComplete"

    I just loaded up the template and didn't get any errors, though I have tried the template with just text that says "this is the template" and that didn't fix it either so I assume it's something else.

    I could PM you with the URL so you could take a look, if that would help at all.
  5. Chris D

    Chris D XenForo Developer Staff Member

    Does this class exist?


    And does it extend XenForo_ViewPublic_Base?

    And does it include a renderJson function?

    You would probably benefit from watching these tutorials:

    mjda and Daniel Hood like this.
  6. mjda

    mjda Active Member

    I didn't think I needed that class to exist, and turns out I was right. After looking at the first tutorial video you posted, it realized that I only needed to add class="OverlayTrigger" to the form submit button. o_O So many hours spent working on this silly thing, trying numerous different things, and all I needed was a single class. :ROFLMAO: Thanks for posting the videos.
  7. Chris D

    Chris D XenForo Developer Staff Member

    Oh. I see what you're trying to do now :LOL:

    Yeah... doing that is pretty easy :)

    Those tutorials are great for the more advanced stuff.
    mjda likes this.
  8. mjda

    mjda Active Member

    Yeah, I've used that class before several times on buttons but it never even struck me to use it on the form submit button until I saw that video. I'll blame it on old age.

Share This Page