Skip Navigation

[Resolved] set a default parent value for a repeating field group front end form

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1240108
repeating field group default.JPG
repeating field group.JPG

I am trying to figure out how to set a default value to assign a parent post to a repeating fields group front end form. Currently the user has to select from a drop down menu. I want the field to automatically select related custom post type item. I was able to limit the results on the list to be only from the author but I would like it to just default to the associated custom post type to that user. User should only have one custom post type as a "profile/personal page". That field should also be hidden from user.

#1240179

Hello,

I assume we are talking about a Toolset post form for creating child repeating fields group items.

I suggest you follow our document to setup the child form link, it will pass an URL parameter to child form, and set the default value of parent selector:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-when-a-parent-post-is-preselected

Creating forms when a parent post is preselected

#1240516

Hi Luo,

Thanks for your reply. That is a little more helpful but I am trying to accomplish something a little different.

I have set up a custom post type called "Member Details". The posts entries under that will be unique and private to each user. Only the user/author will be able to see and edit the post.

Within that custom post type (Member Details). I have made some repeatable field groups for the user to enter their information in. Those entries will appear on a view I made in a table format.

When I make the front end form for that repeatable field group. There is a field option to choose the parent post entry. The problem is, The user can choose other members post or from a list of multiple posts. I got around from user seeing other users posts by restricting in the options but I would like the default value to be of the users own "Member Detail post" that they would be required to fill out after creating their account.

What would be the process to enable that functionality? Would the link you provided still help with this?

Thanks,

Jatin

#1240649

For the problem:
The user can choose other members post or from a list of multiple posts.

You can setup attribute author="$current" in the parent post selector field, for example:

[cred_field field='@relationship-slug.parent' ... author="$current"]

Then it should be able to output options of current user's "Member Details" posts.

More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

author Optional. Use it with a parent selector field to specify that the list of parent posts should be limited to those authored by the mentioned user ID. The value $current can be used to define that the

And follow our document to set the default value of parent post selector field as I mentioned above:
https://toolset.com/forums/topic/set-a-default-parent-value-for-a-repeating-field-group-front-end-form/#post-1240179