• Resolved cabrailsford

    (@cabrailsford)


    I am attempting to create a hidden field using the special hidden input field. I have created a form and added [hidden example_field default:post_meta], along with making a custom field called example_field on the page in question. No matter what I put in the meta value, I cannot get it to populate the hidden field’s value. Am I missing something? The documentation page seems to suggest this can be done (with Getting Default Values from the Context). I am using the latest version of CF7, and can make it at least give me a fallback default when the post_meta value doesn’t work, but I need to differentiate between 2 values depending on the page. Thanks for any help in advance!

Viewing 8 replies - 1 through 8 (of 8 total)
  • thats in the form what about mail

    thats in the form what about mail

    Thread Starter cabrailsford

    (@cabrailsford)

    The mail also does not have a value for the hidden field. The value doesn’t get propagated into the form when the page is loaded (which I believe is the intention), and it does not submit any value either through to the mail.

    have you tried

    [hidden your-email default:user_email “[email protected]”]

    just to test

    Thread Starter cabrailsford

    (@cabrailsford)

    Yes, that example works just fine, and manages to pull the user email data. For whatever reason, the post_meta simply does not pull in the corresponding custom field information for the page the form is located on.

    Thread Starter cabrailsford

    (@cabrailsford)

    Anyone else have an answer for this? I can’t seem to get it working, regardless of following all the documentation from the CF7 website.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Can I see the site?

    Thread Starter cabrailsford

    (@cabrailsford)

    As a follow-up, I tested the same code on another site and had no issues, so I did a little more digging. It seems the problem was that I was using the CF7 shortcode outside of the loop, and while it displayed the form fine in the template, it was not able to parse the page post_meta. Moving the shortcode into the loop seems to have resolved that issue.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hidden Field with Default:post_meta’ is closed to new replies.