• Resolved blueoaks

    (@blueoaks)


    In the documentation here
    https://xnau.com/multiple-databases-with-participants-database/
    it says that

    The key to this is a field that differentiates the records. For this, we create a field named “type” that will indicate whether the record is for a team member or a parent. Make this field a hidden field and set the default value to post->post_name. What this will do is record the name of the page the signup form was on. With that, you’ll be able to tell which form was used to create the record.

    I’ve done this: created a hidden type field with default of post->post_name and I have this field on Page 1 of both instances of my 5 page form. However what gets returned in List Participants is the slug of Page 2 (wordpress child page) rather than the slug (or preferrably) Title of Page 1.

    Please advise what other info you need to suggest a solution.
    thankyou

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author xnau webdesign

    (@xnau)

    When you inspect the HTML of the first page of the form, is the hidden field getting the correct value? Next, check to make sure the hidden field is not also showing up on the second page…it should not, or if it does, it should have the original value.

    You should be able to check the saved values after submitting the first page, the value for the hidden field should be set at that point.

    The field can be set up to grab the title of the page, but i don’t recommend that because titles are more likely to be changed, especially by other editors that don’t know how things work, and that would break whatever actions you have set up on the specific value. Also, titles can have characters that can cause problems in the php logic. Page name strings are reliably safe.

    Thread Starter blueoaks

    (@blueoaks)

    My field slug is form_type but upon inspection of the first page on the front end I can find no instance of pdb-form_type anywhere.

    I do find this on page 2:
    <input name=”form_type” type=”hidden” value=”partner-property-details”>

    So even though form_type is within a field group that is only included in the shortcode for the 1st page it is appearing on the 2nd page and I am not sure how to fix this.

    This is my shortcode on Page 1:
    [pdb_signup groups=”main,property_summary” action=”partner-property-details” submit_button=”Save/Next”]

    This is my shortcode on Page 2:
    [pdb_record groups=”property” action=”partner-terms” submit_button=”Save/Next”]

    My form_type field is part of the group “main”

    What I want form_type to return is:
    <input name=”form_type” type=”hidden” value=”partner”> which is the slug of page 1.

    Plugin Author xnau webdesign

    (@xnau)

    The hidden field does normally show up on all the pages of the form. I don’t know why it wouldn’t show up on the first page…check to make sure you have “signup” checked in the definition of that hidden field.

    Thread Starter blueoaks

    (@blueoaks)

    i did not have ‘signup’ checked om that field. i forgot about that setting when this field was subsequently added. i’ll give that a go. thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘post->post_name returning wrong page’ is closed to new replies.