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

mjda

Active member
#1
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:

PHP:
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.
 

Brogan

XenForo moderator
Staff member
#3
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?
 

mjda

Active member
#4
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?
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.
 

Chris D

XenForo developer
Staff member
#5
Does this class exist?

'Addon_ViewPublic_Index'

And does it extend XenForo_ViewPublic_Base?

And does it include a renderJson function?

You would probably benefit from watching these tutorials:

 

mjda

Active member
#6
Does this class exist?

'Addon_ViewPublic_Index'

And does it extend XenForo_ViewPublic_Base?

And does it include a renderJson function?
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.
 

Chris D

XenForo developer
Staff member
#7
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

Active member
#8
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.
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.