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

Having Issue with Form AutoValidator...

Discussion in 'XenForo Development Discussions' started by Jaxel, Aug 25, 2011.

  1. Jaxel

    Jaxel Well-Known Member

    So I added the class "AutoValidator" to one of my scripts... specifically XenMedio.

    By adding this class, the system will check to make sure there are no errors before moving on. If there are errors, it will load a popup to the user with the list of errors.

    Yesterday, it was working how I would want it to work for someone submitting new media to XenMedio. If there was an error, it would load the popup. If there were no errors, it would insert the media, then LOAD THE MEDIA PAGE.

    Today, its working differently, and not how I want it to work. Today, when there are no errors, it would insert the media, but instead of loading the media page, it will just scroll down "your settings have been saved". Naturally, this is not what I would want to do.

    Why is it no longer working the way I want it to?

    Below is my relevant code...
    Code:
        public function actionSubmit()
        {
            if ($this->_request->isPost())
            {
                // removed stuff
    
                $media = $this->getModelFromCache('EWRmedio_Model_Media')->updateMedia($input);
                return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildPublicLink('media', $media));
            }
    
            // removed stuff
    
            return $this->responseView('EWRmedio_ViewPublic_Submit', 'EWRmedio_Submit', $viewParams);
        }
     
  2. Jaxel

    Jaxel Well-Known Member

    Figured it out... I needed to add:
    Code:
     data-redirect="true"
    However, I didn't have this code yesterday either... so why did it work?
     

Share This Page