• All,

    I am trying to fill a hidden field in the participants database, but am not successful and getting a little frustrated.

    I followed the instructions given in the help manual but somehow I can not get a hidden field filled.

    I am developing in the WAMP.

    Here are the manual instructions for the participants database.

    Hidden Signup Fields
    There is a field type called “hidden” that can be used to add dynamic values to the signup form submissions. For instance, if you had the signup form in multiple locations on your blog, you could know which page the user was on when they signed up because the page name would be placed in a hidden field. Here is a quick tutorial showing how to add a field that tracks the page the signup form is on:

    Add a new field with a descriptive name, like “source page”
    Make that field a hidden type
    For the default value, put “post->post_title”
    This will fill in the title of the page the signup form appears on.
    When the form is submitted, the information in the hidden field will be included. At the moment, only two WordPress objects are available: $post and $current_user.

    I even named my database field the same.

    I also tried this
    [pdb_signup input type=hidden name=post_title value=”training” ]

    But whatever I try the field post_title remains empty.

    Who can help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You don’t put the hidden field in the shortcode. You need to set the field settings for your hidden fields to appear in the signup form that same way you would any other field for the form. They also have to be in a group that is marked “display”

    So your shortcode doesn’t have to have anything special in it, just [pdb_signup] and it will work if you’ve configured it right.

    Once you’ve set up your hidden fields to show in the signup form, go to the signup page and check out the HTML, you should see your hidden fields at the top of the form, and you can check that the value is getting filled in correctly.

    Thread Starter waltersc

    (@waltersc)

    Dear xnau,

    Thank you for answering. I still have not got it to work.

    What I did is:
    1) Installed and activated the participants database + left everything default
    2) Added a field to the database:
    Name = post_title ; Form_element = hidden; values = post->post_title; display_column = 5; admin_column = 5; sortable=check; sign_up=check

    I added a post with a post title and in the part to type the post text I put [pdb_signup].

    When I fire the post the sign_up form shows up with the default fields of the database. I fill them out press enter and get the thank you screen.
    In the participants database the post_title is empty and the other fields are filled out.

    If I look at the html page I see all the database fields that can be filled out, but I do not see the post_title field.

    Thank you for your time,
    Cai Walters

    ?You have to put your post_title field into a group that has “display” checked…check the settings for the group.?

    Thread Starter waltersc

    (@waltersc)

    Xnau,

    What I did wrong was that I put values = post->post_title, and what I needed to do was default = post->post_title

    Thanks for your time Xnau and hopefully this post will help some other dummy who does not read the manual correctly ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[participants database] Hidden fields do not get the post value’ is closed to new replies.