Forum
Passing perch system variable into perch_form template
Is it possible to do this? I was hoping I could use:
PerchSystem::set_var('usage_type', 'test');
<?php perch_form('search_form.html'); ?>
AND in my search_form.html template
<perch:content id="usage_type" />
But I don't get any output. If this isn't possible does anyone have a work around to set a variable in a perch_form template?
Just to add a little more information about what I'm trying to do. I have a number of select boxes which use javascript to show hide other selects based on the selection. When the form is submitted I need to pass in which one is currently in use, else the 'active' select box isn't showing and defaults to hidden.
perch_form()
won't render any<perch:content />
tags.What does
<perch:showall />
output?Ah yes, it's showing in there with the correct ID "usage_type" and the correct value but I can't work out how to output it?
ah got it, I used
is that stable/ok to use?
Secondly, I'm then trying to use this variable to show/hide the appropriate select boxes so if the variable equals meetings I'm trying to do something like this:
Isn't quite right as that is related to 'content' but is something like that possible?
Yes, that's ok to use.
Thanks for helping me over the line Drew, much appreciated!