Tell us what you are trying to do?
I created a ticket regarding contribution forms, and it will soon be continued. However, when creating the form, I encountered an issue with repeater fields. I've read through the documentation and found out that I need to create a standalone form to address the repeater fields. I've done that (see image). Then, I created a page and initially placed the repeater field form within a Lightbox frame using a shortcode. Afterward, I embedded the main form using Forms. In the main form, I added a link at the specified location that calls up the repeater field form.
The form does appear, but with an additional dropdown menu labeled with the CPT (Custom Post Type) name and no selection options. Moreover, it's a simple form that doesn't provide the option to save multiple records.
Hello. Thank you for contacting the Toolset support.
When you add a child form (repeating field group) form it will not get the parent reference. Can you please share details where exactly you added the repeating field group form - is it on the parent post page? If yes: then you can set the default value attribute for your parent dropdown that is available with your child form (repeating field group form) select for value attribute : value="[wpv-post-id]"
Does that works?
If that does not help, please share admin access details and problem URL where I can see the issue.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
Ok I see you have a add new form to add new post for the post type "websites" using the form "projekt-erstellen".
So in that case you will have to first add the new post using the form you have "projekt-erstellen".
So for instance you have already added the form here:
- hidden link
On submit of this form, you will have to redirect the user where you added a child form.
For that, you should add a new page for example "Add Filialen" that should hold your child form (repeating field group form) so add the following form to this newly created page and save your page
- hidden link
Where:
- 82265 is your parent form ID
- 'add-filialen' is your page slug that holds the child form to create new repeating field group post
Please let me know how it goes as you will have to first add the parent post and once parent post is added we will get the parent post ID and then we will be able to create child (repeating field group) posts.
I'll try, but the issue I'm facing is that my form is structured as follows:
Question 1 -> Answer: A, B, C -> If the answer = B => display the "Filialen" form => else, display something else
This structure is used in 5 different places, so I need a solution that doesn't send the user to a new page each time he wants to add information to a repeatable field. I could also program something on my own, like an Ajax request to load the "Filialen" form or load it via an iframe.
For now i restructure the "first form" so it can be saved and try to replicate your advice.
Let me try to explain you again, the repeating field group is managed as one-to-many post relationship where the parent post where you add the repeating field is parent and all items you add to the repeating field group will be treated as child.
As you may know some code so you can understand that without creating parent (without having parent ID)we can not connect the repeating field group items you create to the parent post.
So it must require you to go step by step. First you should create a parent post and then redirect user to the another page where you added the repeating field group form. This is the standard flow. As you must create parent first in order to connect the repeating field items to its parent.
I believe I've understood the logic behind the setup. I've added a form for creating the CPT "Webseiten" and another form for editing it. Then, I've created a content template that loops through the created CPTs for the author only. Additionally, I've created another content template in which the form is embedded, and also included the "Filialen" subform in it. I've added a custom edit link to the loop. It works in such a way that I can create and edit a CPT.
However, the second form, "Filialen," is being displayed, but it can't find the ID of the opened CPT. I tried: [cred_form form="subform-filialen"], [cred_form form="subform-filialen" post=[wpv-post-id]] and [cred_form form="subform-filialen" value=[wpv-post-id]]. In all cases it displays the dropdown menu to select the CPT. In this menu i can select the CPT and add Data to the CPT via the repeater Field.
Besides that there is one big problem. The CPT have to be "private" so only the author is able to read and edit them but if I set them to private, the repeater field is unable to find them (I am not sure if this is a topic of a seperate ticket or its related enough to stand here)
Can you please share details what forms you created now and where exactly with what page you are displaying those forms and to what page you want to display what form.
I have set the next reply to private which means only you and I have access to it.