Lovely. simplified the previous code some by doing :
{if segment_2 == "thanks" OR segment_3 == "thanks" OR segment_4 == "thanks"}
and it worked fine.
That way I could put the body of the form in an {else:if} statement and so show either the form or the thank you message.
However. I was trying something else… to add an in-page link www.somedomain.com/index.php/company/testimonials/thanks#ty
The a name="ty” at the Thank You statement will scroll browser down to where the form used to be, making it obvious that yes, we got their input, thanks.
But it seems that freeform’s return= will automatically append a final / at the end of the url. Is there any way to override it?
The code I’m using in the form (broken into 3 lines for ease of reading. Look at the third line):
{exp:freeform:form form_name="site_lead" required="name|email|phone1"
notify="blah@domain.com" template="contact_form" charset="utf-8"
return="{segment_1}/{if segment_2}{segment_2}/{/if}{if segment_3}{segment_3}/{/if}thanks#ty"}
Which results in this (note the / at final end of URL:
www.somedomain.com/index.php/company/testimonials/thanks#ty/
If there’s a final slash in the URL, no scroll down.
If there’s NO final slash, then page WILL scroll.
I guess I can put the thank you message higher in sidebar to omit scrolling (but that means more embed templates). Workarounds? We always have workarounds.