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

Redirect after submitting rating form

Discussion in 'XenForo Development Discussions' started by Jake B., Feb 23, 2015.

  1. Jake B.

    Jake B. Well-Known Member

    I'm trying to make a redirect after the rating form is submitted, but it will not redirect it's just displaying the message and not continuing to the next page. Any ideas?

    - Jake
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Do you have the data-redirect="on" attribute set on the form element?
     
  3. Jake B.

    Jake B. Well-Known Member

    Yep, I've tried that already :p

    - Jake
     
  4. Chris D

    Chris D XenForo Developer Staff Member

    Well, there wasn't a lot of info to go on to be otherwise sure of that.

    You might need to expand a bit as it is, because obviously the default behaviour of the rating form in the Resource Manager does redirect as expected. Is there any other JS involved? Any errors in the browser console? What does your template and controller look like?
     
  5. Jake B.

    Jake B. Well-Known Member

    I've sent you a PM as most of this was not created by us, and we were just hired to improve on some things. So I'm not sure that I can publicly share the code from it

    - Jake
     
  6. Chris D

    Chris D XenForo Developer Staff Member

    Thanks.

    The code doesn't use AutoValidator so most of the behaviours including the data-redirect flag won't do anything.

    You will likely need to handle the redirection code yourself in the JS, unless setting AutoValidator on the form will perform how you want it but I suspect it might not; you'll have to test that.
     
  7. Jake B.

    Jake B. Well-Known Member

    I've tried adding the AutoValidator class as well, with no luck. I know the rating system wasn't meant to work like this as it usually goes to another page that has you enter a review (like with the resource manager). We'll keep looking into it, thanks for your help Chris!

    - Jake
     

Share This Page