Skip Navigation

[Resolved] Open child cred form from with in parent cred from

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to add a form to publish child posts to a form that publishes parent posts?

Solution:
In HTML you cannot nest forms.

The expected workflow would be something like a form to publish the parent CPTs is inserted on one page, which displays the post after submission.

The template for that post type includes a link to an edit form for the post, and also includes the form to add child posts (either directly, or linking to the form).

This support ticket is created 6 years, 1 month 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by AndreG3332 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1156170

I have the following:
A company CPT.
A contact person CPT

The company is in a one to many relationships with the child - Contact person CPT
I have created a Cred form for both.

I now need to set a link on the parent form that when the company details have been edited that the Contact Persons details can be added.
How do I go about achieving that?

#1156263

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Typically with forms to add child posts, in the template for the parent post you would include either the child form directly (you might hide it inside an accordion panel), or a link to the child post form (which is hosted inside a content template).

You can't nest forms in HTML (e.g. a child form inside a parent form) and it may not make sense to put two forms one after the other on the same page (each with its own submit button).

For your case I would imagine something like a form to publish company CPTs on one page, which displays the post after submission.
The template for the post includes a link to an edit form for the post, and also includes the child post form to add contacts (either directly, or linking to the form).

Does that suit your intended workflow?

#1156853

My issue is resolved now. Thank you!