Hidden Field with Default:post_meta
-
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!
-
thats in the form what about mail
thats in the form what about mail
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.
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.
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.
Can I see the site?
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.
The topic ‘Hidden Field with Default:post_meta’ is closed to new replies.