You can include a selector for the "one" part of relationships in standard forms, but the "many" part would require using a relationship form.
So in your case if you have CPT A << CPT B (B is a child of A), in the form to publish a CPT B you can include a selector to choose the A the new B will belong to. (If you have the relationship already set up when you create the form, this selector will automatically be added.)
You can't have a form to publish CPT A and include a selector for which CPT B's to connect to it (because there could be many B's).
Hi Nigel
I thought so.
I am in the process of creating a pop-up window that contains the relationship form.
The form for CPT A will have a button that opens a new window, and when the relationships are set, the window closes, and the original window appears.
The button in the form for CPT A must save the form set the postid as an URL param.
I have everything, but the save action.
Can I use a submit button, or do I have to use custom PHP code?
Please elaborate the question with more details:
The button in the form for CPT A must save the form set the postid as an URL param.
What kind of URL parameter are we talking about? How and where do you setup this URL parameter?
Please provide detail steps to reproduce the same problem
Hi
I solved the "pop-up" window with cred_success_redirect and an isset($_POST['form_submit']) check in a PHP function. Now I have another problem.
cred_success_redirect is not working with my relationship form (it is a many to many relationship). I read the post "form hooks not working with relationship form" - https://toolset.com/forums/topic/form-hooks-not-working-with-relationship-form/
Do you know if there is a fix coming out soon? And is there a workaround?
For the new question, I have checked it in our to-do list, it is still in "feature request" status, and I have added this thread into it, hope it can raise our developers's attention.
Hi Lou.
I solved the redirect issue with javascript.
I have another question. Is it possible to have a "multi-select" dropdown in a "many to many" relationship form?
Truls
New threads created by Luo Yang and linked to this one are listed below: