Jaxel
Well-known member
I have a form:
As you can see, it is a formOverlay created through "OverlayTrigger". In addition to that,AutoValidates and I am registering it through AJAX using "ResultPoster".
Its basically the simplest AJAX you can do... when the form successfully validates, it replaces #eventResults with the returned response templateHtml. This is all working correctly. The problem comes with the actual script.
Using the following works:
However, if I use a responseRedirect instead of a responseView, it doesnt work... templateHtml is always undefined.
Is there a reason for this? How do I fix?
Code:
<form action="{xen:link 'rankings/result/edit', $result}" method="post" class="xenForm formOverlay AutoValidator" id="ResultPoster">
Code:
/** @param {jQuery} $ jQuery Object */
!function($, window, document, _undefined)
{
XenForo.ResultPoster = function($form)
{
$form.bind('AutoValidationComplete', function(e)
{
if (e.ajaxData.templateHtml)
{
new XenForo.ExtLoader(e.ajaxData, function()
{
$(e.ajaxData.templateHtml).xfInsert('replaceAll', '#eventResults', 'xfShow');
});
}
});
}
// *********************************************************************
XenForo.register('#ResultPoster', 'XenForo.ResultPoster');
}
(jQuery, this, document);
Using the following works:
Code:
if ($this->_noRedirect())
{
return $this->responseView('EWRtorneo_ViewPublic_EventResults', 'EWRtorneo_EventResults', $viewParams);
}
Code:
if ($this->_noRedirect())
{
return $this->responseReroute('EWRtorneo_ControllerPublic_Rankings_Event', 'Results');
}
Is there a reason for this? How do I fix?