Show template in overlay after form submit.

mjda

Well-known 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:

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

To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.
 
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.
 
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.
 
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.
 
Top Bottom