Forum
Displaying thank you page content depending on a specific form value
Hi,
I have a Perch form that includes a <select> element with four options. On form submission, I need to send through a Google Analytics script that is specific to the selected value of the <select>. I tried to use a <perch:if> within a <perch: success> block to check against the value of the <select>, but that didn't work. What would be the best way to achieve what I need?
Thanks in advance for any input and guidance.
Have you tried displaying the form using either
perch_content()
orperch_content_custom()
?Hi Philip,
Thanks for your reply. No I haven't tried that. Would that approach allow me to get the <select> value from the form and then display content specific to that value on the thank you page?
Apologies, I've got myself mixed up. Are you wanting to setup a separate thank you (redirect) page in the form settings? Drew or Rachel will have to answer that one, as it sounds like a custom PHP job (if it even is possible).
It is possible however to display different content within the
<success>
field based on the value of the select field (if you're using<success>
instead of a separate redirect thank you page):Thanks Philip. Yes, the aim is to deliver an Analytics script that's specific to a value of a <select> in the form. Using a <perch:if> within the <perch:success> was my initial attempt at this, but I can't seem to get any output from that at all.
You'll need to read those values in the page and then pass it into the template.