Forum
Forms App and hidden fields
Hi Drew/Rachel,
Is there any way to either:
a) Pass in the page title shown on the stored form response to the email response?
or
b) Pass in the page title using
<perch:pages id="pageNavText" />
somehow perhaps in combination with a hidden field
<perch:input type="hidden" id="centre" value="<perch:pages id="pageNavText" />" label="Centre" />
In short, my client needs to know which page the form was submitted from as we are using the same form, on different pages, created from a master.
Yes, you can do that. Pass it into the template: https://docs.grabaperch.com/docs/templates/passing-variables-into-templates/
Hi Drew,
Thanks for this. Im nearly there but just not sure how to get my data in to the variable.
On the page I have this code:
In the form template I have this:
All works fine and 'en' is passed in to the email and form response in Perch.
My issue is replacing the 'en' with
I just get a blank or <perch:pages id="pageNavText" /> in the response.
I am clearly doing something wrong but I am not sure what!
You need to use
perch_pages_navigation_text(true);
like this:Hi Drew,
That has worked perfectly. Is there any documentation on this:
So I can understand it better?
Thanks, Andy
Yes, I searched the docs for the function name:
https://docs.grabaperch.com/docs/navigation/perch-pages-navigation-text/
Thanks Drew, it was me being thick, I searched but on the forum rather than docs... :(
Sorry Drew,
Related to this, can we do the same sort of thing with a select field? I need to populate the options="" on a perch form with the perch_pages_navigation_text
Yes, that should work with the options attribute too... just add your tag as the attribute value. Content tags are parsed before form tags.
Hi Drew,
I just can't get this to work whatever I do :(
I have a static page with the following code:
and the template contains this select field:
...but the select options are not showing.
I have alson tried:
but this doesn't work either.
Any ideas?
Ah, try using
perch_content_custom()
to display the form.perch_form()
won't do the content substitution.Hi Drew,
Im nearly there (I think). I am now using this code on the page:
and this in the template:
...but I'm getting all of the results in as one option in the select list.
When you view source on the HTML page, what does the select field look like?
Hi Drew,
It looks like your template is missing a comma.
Spot on, thanks Drew... I need to learn to look for the simple stuff!