HTML fields aren’t stored in the Gravity Form Entry which is why you are experiencing this issue.
To correctly manipulate the HTML field details in the PDF you would need to modify the actual $form array / object by tapping into the gform_form_post_get_meta filter (found on line 324 of the forms_model.php file) and modify the HTML field’s content as per your requirements.
Thanks for that. I think I’m going to use the gfpdfe_template filter that you have documented. We have a hidden field I forgot about that has the ID that I need. I’ll just create 2 HTML fields and then set up a template that calls the right HTML field for that condition.
It doesn’t seem to be working, what does the $lead mean in the gfpdfe_template filter script?
if($lead['form_id'] == 17)
I’m trying to pick up a hidden field that has the ID of 60, it has the value of 487 that I need.
if($lead[60] == 487)
Should that work? Here’s the whole code:
function gfpdfe_template_alteration($template, $form, $lead) {
if($lead['form_id'] == 17)
{
/*
* Change the PDF template based on input - $lead[60]
*/
if($lead[60] == 487)
{
$name = 'name-487-template.php';
}
else
{
$name = 'name-template.php';
}
}
return $template;
}
add_filter('gfpdfe_template', 'gfpdfe_template_alteration', 10, 3);
Hi,
Change your variable assignments to $template = 'name-487-template.php'; and $template = 'name-487-template.php'; respectively.
Ah, that would make sense, wouldn’t it :/ Thanks for your help!
You may want to update this page to reflect that change, if it’s supposed to be $template, it says $name.
Thanks!
John