Skip Navigation

[Resolved] Single form that creates parent and children using repeater

This support ticket is created 5 years, 11 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by zacharyL 5 years, 11 months ago.

Assigned support staff: Noman.

Author
Posts
#492877

Here's what I'm trying to do:

Parent Post Type: Career Pathway
Child Post Type: Career Pathway Item (ie. Standardized Test, Degree, New Job)

I'd like to create a form that allows the user to define fields on the Parent post (Target Career, expected Salary, etc), as well as add a variable number of "Career Pathway Items" (ie. an Associates Degree, a Bachelor's Degree, their First Job). I am seeing a way to do this on the way end, but I'm not seeing a way to create a CRED form that can handle it.

If I understand Nigel correctly in this thread (https://toolset.com/forums/topic/how-do-simple-repeater-field-in-frontend-form/), his suggestion was to have multiple forms: 1. Create the Career Pathway 2. Add an Item to it 3. Add another Item to it, etc, so it would require multiple forms on multiple pages to accomplish this, which would also complicate my entire implementation as I don't want the created posts viewable on the front end until they're approved.

Is there a way to do this yet with one form?

#492981

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Zachary,

Thank you for contacting Toolset Support.

1. Can you please explain bit more about the form funtionalty and working you want to create:
- Step by step details that how you have created form?
- Which fields you want to display on the form? Fields from Parent CPT and child CPT?
- What you expect to see?

2. Can you please send me link where you have created the form?

Looking forward to help you.
Thank you

#493368

I haven't created the form yet, as I'm struggling to find a way to do so, so here are some more specifics:

Summary

I'm creating a "Timeline" project, where visitors can submit their entire "Career Path", including what they we're striving for and a variable number of events (called "Career Path Items") that lead up to their current job.

Screenshot - Timeline View for a Career Path (which displays its child Career Path Items as well): hidden link

Screenshot - Form where user can create a Career Path and add a variable number of Career Path Items: hidden link

Post Types:

  • Career Path
  • -- Field: Career Path Name
  • -- Taxonomy Field: Education Industry (Math, Science, etc)
  • -- Field: Expected Pay
  • -- ...etc
  • Career Path Item
  • -- Taxonomy Field: Item Type (Education, New Job, etc)
  • -- Field: Expected Pay
  • -- Field: Name of Degree (conditional - if type = education)
  • -- ...etc

<br><br>

Goal:

I'm looking to create a single form with the following:
- Fields for the parent post type "Career Path"
- A "Repeatable Group of Fields" for the child post type "
Career Path Item"
- "Add another Career Path Item" button (can be used variable number of times)

Result upon Submission:

  • 1. 1 post of type "Career Path" would be created
  • 2. Multiple child posts of type "Career Path Item" would be created and parent of each of those set to the above post (#1)

<br><br>

Right now, I know I can use Gravity Forms with the Repeater Add-On to create a form like this, but I will have to custom program both the taxonomy dropdown fields and the entire connector that creates these posts upon submission.

I know you can do all this on the back end out of the box, but is there a way to do this entirely with Toolset's CRED yet?

#493631

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Zachary,

Thank you for providing more details. For Types Repeating Fields and then to add them in your CRED forms, please refer to the following links that may help you:
https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/
https://toolset.com/documentation/user-guides/repeating-fields/

If you want to display child posts repeating fields (relational posts fields) inside your CRED form, that might not be possible. I have discussed this feature with Development team and they have informed that Repeating field groups are just children posts from a children post type, not actual fields from the parent post. That’s why CRED can not include children fields in a form.

Thank you.

#493802

I had a feeling this was the case. It would be super cool if you added this ability in the future. For now, I'll write a Gravity Forms implementation and a connector for it. Thanks!