Skip Navigation

[Resolved] Embedding Relationship in forms

This support ticket is created 3 years, 10 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 4 replies, has 2 voices.

Last updated by Luo Yang 3 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1661053

I know there is a "relationship form" but my goal is to create a post and to associate a relationship to another post in one form.

I can not associate relationships between posts on the front end through standard forms. Is there a way around that?

#1662803

Hello,

For one-to-one and one-to-many relationships, you can embed the relationship field into the post form, see our document:
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/

For the many-to-many relationship, you will need to use relationship form, since there will be intermediate post involved in this case, see our document:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

There isn't other way around for many-to-many relationship.

#1663613

Maybe I can explain a scenario and you could tell me to best how to proceed. I have Service Providers I would like to add. Our Real estate agents are the ones doing it (from the front end). Our many service providers can work in many cities. (Many-to-Many). From what you described, there's no way for my agent to add a service provider and say they work in these "6" cities (aside from using cities as a clickable taxonomy (the reason i'm not doing that is I need the filterable relationship on the front end when searching)

#1663791

Is it possible then to put the relationship form (M2M as a checkbox) and to place the relationship forms in a single page with one submit button.

My hope would be a form to add a service provider (post form) and to connect that provider to a Service area (m2m relationship) and to a service category (m2m relationship)

or would you need 3 submit buttons for each form

#1664217

I assume we are talking about many-to-many relationship between post types "Service Providers" and "cities".

As I mentioned above, for M2M relationship, you will need to follow our document to setup the relationship form and connect "Service Providers" post with other "cities" posts:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

It is not possible to embed one HTML form into another HTML form, this is a limitation of HTML
hidden link

"Every form must be enclosed within a FORM element. There can be several forms in a single document, but the FORM element can't be nested."

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.