I am hoping this is possible!I have two custom post types in a many to many relationship. When the user creates the 'child' post I want the form to set and save the value of a parent using a generic select field and a view to get the parent.
The form successfully displays the select field and gets the parent post as the option but the user still has to select it... If the user selects it the relationship is also saved successfully. So everything works!
I just can't figure out how to get the form to set the value so the user doesn't have to.
Hello. Thank you for contacting the Toolset support.
The form successfully displays the select field and gets the parent post as the option but the user still has to select it... If the user selects it the relationship is also saved successfully. So everything works!
I just can't figure out how to get the form to set the value so the user doesn't have to.
===>
Do you mean you what to set current post where the form is displayed as the parent post of your child and with the parent drop-down select you want to set the current post as the default selected option?
Hi Minesh
Yes. Exactly. Actually I literally just this minute figured it out. I need to add a default with a view that gets the parent post's ID only. So I now have this:
So now I have a new problem... The parent is selected in the cred form but now the relationship is not saved when the child post is created... so the function is not working anymore.
Minesh!
I got it. I have a SELECT field in the cred form but the function is expecting a MULTISELECT field. So I changed the cred form generic field to a MULTISELECT field and it works. Problem solved!