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 :)

Type: Discussion
Status: New
invision
View Replies:
DeWebmakers replied on at Permalink Reply
DeWebmakers
I think it's possible...but I'm not sure how...

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!
invision replied on at Permalink Reply
invision
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:

if ($questionRow['inputType'] == 'hidden')
   echo '<input name="Question' .intval($questionRow['msqID']). '"
 type="hidden" value="'. $_GET["opportunityID"].'" />'."\n";


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?

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.