How to pass a variable to form?
Permalink Browser Info Environment
I'm using this add-on, and it's working great, but I'd like to send an encoded URL with a variable to a hidden field in the form.
I know how to do it in hand-coded site, but no idea how to make it work in c5/Extended Form.
I've tried adding a hidden field with a value of '<?php echo $opportunityID; ?>' but that plugs that literal text into the field value, and doesn't parse the php.
Any ideas how I can accomplish this? I suppose I could edit the core code or add a template, but it sure would be nice to just plug it in in the interface :)
I know how to do it in hand-coded site, but no idea how to make it work in c5/Extended Form.
I've tried adding a hidden field with a value of '<?php echo $opportunityID; ?>' but that plugs that literal text into the field value, and doesn't parse the php.
Any ideas how I can accomplish this? I suppose I could edit the core code or add a template, but it sure would be nice to just plug it in in the interface :)
Type: | Discussion |
---|---|
Status: | New |
Just to get the results I needed, I added a hidden field to the form in form edit mode, then I added some code to the /models/survey.php file to receive the hidden info:
the 'opportunityID' value above is the value passed from the original, unique link to the form, like this:
It's a hack, but it works. It would be nice to have this functionality built in. Perhaps in the next version?
the 'opportunityID' value above is the value passed from the original, unique link to the form, like this:
<a href="/index.php/branch-application/?opportunityID=MTG000"> Apply Here</a>
It's a hack, but it works. It would be nice to have this functionality built in. Perhaps in the next version?
Maybe we should add a new field called php or something... I know there is an addon to add php code to the content, maybe we can take a look at how they did it...
I'll get back to you on that!