I am redirecting a user to a custom template after they submit a form. I'd like to include their name on the thank you page, but as it's a redirect, I can't get any form data.

I tried editing this line on mod.forms.php

$form['return'] = $form['form_settings']['return_url'];


$form['return'] = '/mytmeplategroup/thankyou/' . ee()->input->post('name_first');

But as the return URL is generated BEFORE the form is submitted, this is clearly the wrong answer.

Can I pass custom variables to a new template (worst case, just a form submission entry Id and I can go get the data perhaps?)

2 Answers 2


You can use use a variable in your return url like this:


And on the thankyou template do something like this:

{exp:forms:entries fentry_id="{segment_3}"}


I dunno what Forms is doing with return_url, but could you do something with JavaScript in the generated form's onsubmit event?

  • Need a non JS solution sadly.. I ended up 'hacking' the module.. added a hidden field on the form page too.. using that to set a session and pick up the data elsewhere... phew!
    – Beertastic
    Commented Aug 28, 2013 at 12:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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