Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author rolandbarker

    (@rolandbarker)

    You don’t mention how you know it didn’t work, but the best way to tell if this feature of hidden fields is working is to inspect the HTML of the form and find the hidden fields, which will be at the top of the form near the <form> tag.

    The syntax in the “default” setting of the field is simply post->post_name

    There are a couple of reasons why this might not work as expected. First, the field must be included in the form, so if it is a signup form, the signup checkbox in the field definition must be checked. This is why inspecting the HTML is helpful, so you can check to see that the hidden field is there, and what value it holds, since the default value will be placed in the field before it is printed to the page.

    The second reason this might not work has to do with the context of the shortcode you are using to display the form. It has to be in a context where the WP $post global is available and will have the “post_name” property. For example, if it is in a widget, this might not work…or if you’re using a type of layout block where the content is placed on the screen using JavaScript, it might not work there either. Try putting the shortcode on a regular page in a shortcode block.

    If your site does not use text permalinks, then the post_name property might be empty, you may need to use post->ID instead so you can get the post ID of the page.

    Thread Starter rramosf

    (@rramosf)

    Thanks for your reply. I have checked the HTML of the form and using both the default value ‘post->post_name’ and ‘post->ID’ register the value correctly (hidden field name: post_data), you can check it in this URL where I am testing (https://devacuabit.es/test-wp/inscripcion-1/).

    There are some details that may help:

    • I’m using a multiplingue site with the Polylang plugin (I think it’s the one recommended for Participans).
    • I’ve installed Email Extensión Kit
    • The registration form is on a normal page.

    Another problem I am encountering, is that the value of the hidden fields is not exported to a CSV even if I have checked that option in the field, I have checked the documentation but I don’t see anything related to this.

    Thank you very much in advance.

    • This reply was modified 7 hours, 51 minutes ago by rramosf.
    • This reply was modified 7 hours, 50 minutes ago by rramosf.
    Plugin Author rolandbarker

    (@rolandbarker)

    OK, so the hidden field has the correct value in the HTML, but it is not saving that value? When you look at the record after it has been saved, the value is blank?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.