Problem: I would like to automatically select the parent post in a new child post Form. I have a View that returns the correct parent post ID, so I would like to use that View in the Form shortcode but it does not seem to be working correctly.
Solution: It is not possible to set the parent post ID using an attribute in the cred_form shortcode, only in the parent post cred_field shortcode. You have the following options:
1. In the URL of the page containing the New House Form, add the correct parent post ID in a URL parameter. Use the urlparam attribute in the parent post cred_field shortcode to supply the name of the corresponding URL parameter. Example where the URL parameter is areaid:
[cred_field field='@book-chapter.parent' urlparam='areaid' class='form-control' output='bootstrap' select_text='--- not set ---']
2. Set the parent post ID in the value attribute on the parent post cred_field shortcode. Example where the parent post ID is 1234:
[cred_field field='@book-chapter.parent' value='1234' class='form-control' output='bootstrap' select_text='--- not set ---']
Relevant Documentation:
https://toolset.com/documentation/user-guides/front-end-forms/cred-shortcodes/#cred_form
https://toolset.com/documentation/user-guides/front-end-forms/cred-shortcodes/#cred_field
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 3 replies, has 2 voices.
Last updated by 4 years, 7 months ago.
Assisted by: Christian Cox.