Is it possible within Freeform Pro to set the return path of a form to the current page (ie. if the form is in the template "contact/index", set return="contact/index") and then when it loads the page again and parses the Freeform tag, it runs a check to see if it was sent successfully and display a message and possibly prevent the form from being displayed.

Essentially, I'm looking for the same functionality as you would get with a normal PHP check such as if($mail) { echo 'Success'; // hide form } else { echo 'Error'; // display form }

Can I do this with native EE/Freeform tags or would I have to build something in PHP? If the case is the latter, how would I check it?

Using EE 2.5.2 with Freeform Pro 4.0.12.

3 Answers 3


Not sure you can do it cleanly with the exact same URL - at least I've not tried it - but you can use the prevent_duplicate_on parameter to limit submission by member id, IP address or email address (as entered by user). Then use the if freeform:duplicate conditional to present the user with a message (and avoid presenting the form again). But that's potentially somewhat limiting if with a general contact form, the user may have a legitimate reason for submitting more than once, for example. But if you want to remove the form from the post-submission message, you can simply accomplish that with segments, as with this example:

{if segment_2 == thank-you}
    Display post-submission thank you message.
    {exp:freeform:form form_name="contact" return="{segment_1}/thank-you"}
        Insert my form fields here

Then is the user returns to the page that displays the form (at whatever segment 1 is, in this example), they are still presented with the form.

Hope that helps.

  • I've used a similar method for adding a segment to the same page. Because the contact form was on sidebar on all pages of site, it coulda been displayed at the {segment_2} {segment_3} or even {segment_4} level. For the return, I put: return="{segment_1}/{if segment_2}{segment_2}/{/if}{if segment_3}{segment_3}/{/if}thanks#ty" (added the #ty to jump down to the message. I did this using EE 1; now, with EE2, you can use the {last_segment}, i.e., {if last_segment == thanks} display stuff {if:else} form {/if}
    – auntialias
    Aug 6, 2013 at 20:56
  • Yeah, that's a simple enough method and it's what I would normally use, but I was trying to avoid adding a "thank-you" segment. I guess the benefit doesn't really outweigh the cost in this case. Aug 7, 2013 at 0:46

What I always do is use an extra segment for forms that have been submitted, but have Freebie ignore it. This way EE completely ignores the extra segment by default, but you have the control over things in your templates.

For example, in Freebie set "thanks" an ignored segment and then in your template:

{if freebie_last == "thanks"}
    Thank you message/variable/entry field
    {exp:freeform:form return="wherever/you-are/thanks"}

If you use Structure you could have return="{structure:page:url}thanks" (or I assume in Pages return="{page_url}thanks"). This combined with the power of freebie_last means the same code will work despite of its location.


You could use the duplicate checking functionality and show alternate content if they've already filled the form out:


  • I thought that would work, but it doesn't seem to do anything. I tried with the conditions inside and outside the freeform tags. It behaves normally, except that it now sends two email notifications for one submissions. Aug 8, 2013 at 5:32

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.