1

I am having an issue, probably parse related. Using Solspace Freeform I am trying to include the {csrf_token} in the return path but its not working.. my code is as follows for the form:

{exp:freeform:form
                   form_name="whitepapers"
                   required="email|full_name|company|job_title|whitepaper|my_unique_hash|partner"
                   return="/{segment_1}/{csrf_token}"
                   inline_errors="yes"
                }   

It returns to domain.com/segment/%7Bcsrf_token%7D with an error: Error: The URI you submitted has disallowed characters.

I am trying to use the CSRF token to check against buy storing it in a hidden field and using it to display the entry on the return. From this example: http://support.solspace.com/support/solutions/articles/4000032469-how-to-make-freeform-forms-editable-without-using-the-entry-id-in-the-url

Could anyone shed some light or offer a way to do this?

Thanks in advance

  • Have you tried adding parse="inward" to the parameters? – Romans-8---31-39 May 17 '17 at 12:35
1

This is likely due to parse order, where the {csrf_token} variable wouldn't be parsed yet until the {exp:freeform:form} tag has fully rendered, which would be after the parameters have been parsed.

| improve this answer | |
  • The example I was following was from the Solspace support so assumed it would work. I just need to show the users details on the return page, not possible? – Mark May 17 '17 at 2:56
  • The example solution assumes you're generating your own hash (however you might do it), not using the CSRF token. – Solspace May 17 '17 at 3:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.