I have an Freeform entry field {{ pageForm }} where the user can select a form to display on the page.

And then in the page template I load the form in to the page using {{ entry.pageForm.render() }}. Cool.

I also want them to be able to choose the return URL from an Entries field e.g {{ entry.formThankyouUrl }}. Is there any way to pass that formThankyouUrl to the renderTag? E.g the below setup would be ideal..

Page template:

{% if entry.formPageForm|length %}
   {% set thankyouUrl = row.formThankYou.one() ?? null %}
   {{ entry.formPageForm.render() }}
{% endif %}

Form template:

{{ form.renderTag({
  returnUrl: thankyouUrl
}) }}

The reason I ask is that the default Return URL functionality in freeform is quite limited in that you have to paste in the URL, would be good to select it form a entries dropdown

Thanks

  • Are you using Ajax to update the page and bring in the form the user selects, or just unhiding the form? If so, on thankYouUrl field update on the page, update the return URL with JavaScript. Or, if you mean user = Craft user editing entry and selecting form, you can have the template check if thankyouurl has value and pass the custom return in the render parameters (solspace.com/craft/freeform/docs/freeform.form/#render) – Indigo Viking 2 days ago

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.