• Resolved pixelworker

    (@pixelwind)


    Hi, I have a situation where I need to change the wording in a Gravity Forms HTML field on the fly for a given URL (one with a /?ref=487 ID at the end). That is working fine in the browser, but when I submit the form, the PDF has the old wording from the form.

    It seems the data from the input fields is sent, but not the data from the HTML fields. Is that correct? If so, is there a way to send the HTML field with the new text so it shows up in the PDF?

    Thanks,
    John

    https://www.ads-software.com/plugins/gravity-forms-pdf-extended/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jake Jackson

    (@blue-liquid-designs)

    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.

    Thread Starter pixelworker

    (@pixelwind)

    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.

    Thread Starter pixelworker

    (@pixelwind)

    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);
    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Hi,

    Change your variable assignments to $template = 'name-487-template.php'; and $template = 'name-487-template.php'; respectively.

    Thread Starter pixelworker

    (@pixelwind)

    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

    Plugin Author Jake Jackson

    (@blue-liquid-designs)

    Glad you got it working.

    Good idea. Docs updated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘HTML field data not sent on submit?’ is closed to new replies.